remove usage of strndupa

using alloca is dangerous and non-conformant, so musl libc
deliberately did not implement it.