Autoconf getaddrinfo detection, with fallback to original implementation.
Plus const
Review comments - alter ifdef test to get else closer to if, and some style updates.