POSIX-compliant compilation

This patch series contain portability fixes that are enough to let the code compile under strict POSIX compliance and the C99 standard, effectively removing dependency on _BSD_SOURCE and _GNU_SOURCE. They only require _POSIX_C_SOURCE and _XOPEN_SOURCE>=700

The changes have been split in many patches to ease review. The most difficult patch to review is the second to last one: "Replaced rest of s6_addrNN by using generic in6_addr_[gs]etNN() ..."

All patches have been fully tested not to break compilation.

Many patches include remarks for documentation purposes.

Please consider that, although much caution was taken not to break the logic or program flow, many parts of the code were not completely understood, and may now be broken. Please consider reviewing them, particularly the s6_addrNN replacements.

I hope you find this work useful enough to be applied.

Thanks.