Mac, BSD: Use sysctl() instead of sysconf()

Both for finding the number of processors, and for finding the
amount of physical memory.

Header #ifdef for sysinfo.h is mysteriously missing in unsquashfs.c . Use the
exact same code as mksquashfs.c .
Mac, BSD: strdupa() is non-standard

Replace with strdup() and free it manually.
Mac: Emulate sigtimedwait()

Use sigwait() and alarm() for POSIX-compatible handling of SIGQUIT
printing.
clang: Use 'static inline' instead of 'inline'

Clang compiles in C99 mode by default, where 'inline' means there should be
another definition: http://clang.llvm.org/compatibility.html#inline

Using 'static inline' instead works.
Mac, BSD: Ensure endianness is known

- Add endian macros to xattr.c
- Move stdlib.h before squashfs_swap.h in read_xattrs.c
FreeBSD: Add missing header

We need <sys/stat.h> for S_ISDIR and friends.