Fix compilation with musl

I'm packing the tool for Alpine Linux 3.3.
Alpine Linux uses musl-libc as standard C library.
These are the fixes I managed to resolve.
2 files changed