Add support for IPv6 addressing.

Autoconf getaddrinfo detection, with fallback to original implementation.