Fix warning about unused variable triggered when not building on WIN32.
Fix warnings about redefinition of variables, use either sys/xattr.h or attr/xattr.h.
Cast comparison functions to __compar_fn_t if stdlib.h defines it.