Add missing includes for FreeBSD.

src/tcp.c:38: error: 'AF_INET' undeclared here (not in a function)
src/tcp.c:99: error: 'SOCK_STREAM' undeclared (first use in this function)
src/tcp.c:121: error: 'AF_INET6' undeclared (first use in this function)
src/tcp.c:159: error: 'SOL_SOCKET' undeclared (first use in this function)
src/tcp.c:159: error: 'SO_ERROR' undeclared (first use in this function)
Fix compile errors for kqueue on FreeBSD.

src/tvhpoll.c:127: warning: assignment makes pointer from integer without a cast
src/tvhpoll.c:179: warning: assignment makes integer from pointer without a cast