Debian / g++-4.7.2 support

- Fixed compiler errors owing to g++-4.7.2.
- Added AI_ALL to invocation of getaddrinfo() for new connection code. This
  fixes "localhost" name resolution on Debian, which breaks for IPv6 without the
  AI_ALL flag.