Fix compile with musl (lack of strndupa)

If strndupa is not defined, use an in-house implementation
using alloca() (code taken from https://goo.gl/roIJt6).

Patch is based on work by Dennis Przytarski.

https://bugs.openvz.org/browse/OVZ-6650

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
2 files changed