Move more stuff to libcfnet, get rid of some thread-unsafe code

* Move AgentConnection to libcfnet, which caused inclusion of cfnet.h from
  many files.

* Remove cf3.defs.h dependency from most of libcfnet, move network specific
  defines to cfnet.h.

* Remove most of sockaddr.c and replace the thread-unsafe sockaddr_{pton,ntop}
  functions with inet_{pton,ntop} from POSIX, or getnameinfo(NI_NUMERICHOST)
  when HAVE_GETADDRINFO is valid. Needed functionality was retained in
  libcfnet/misc.c, to be removed.

* Detect missing declarations of inet_ntop(), inet_pton() through autoconf and
  provide replacements if needed. For replacements, implementation used is
  copyright ISC and flexibly licensed.
Remove old commented code
Fix generic_agent_test to look for masterfiles in source tree
Use getaddrinfo and friends whenever possible

* Remove lots of old hidden #ifdef !HAVE_GETADDRINFO code that barely run
  anywhere, and use getaddrinfo whenever possible.

* Provide replacement functions in libcompat (Copyright PostgreSQL, freely
  licensed) for legacy platforms.

* Use getnameinfo(NI_NUMERICHOST) to convert IP address to string in a
  IP-version agnostic manner.