Attempting to connect dig to the wrong address via TCP caused a hang on
shutdown due to a dangling socket reference; tcp_connect_cb() was never
reached and so the TCP socket was never detached.
This commit adds a connection timeout mechanism to isc_nm_tcpconnect()
and isc_nm_tcpdnsconnect().
NOTE: Currently this only works correctly with "dig +tries=1". If the
connection is retried, we get a segfault on shutdown in uv_walk(); I
haven't yet worked out why.