Use AC_CHECK_TYPES for socklen_t.
Pull the getaddrinfo and gethostbyname_r checks out of configure.ac.
Pull the kqueue and epoll tests out of configure.ac too.