allow shutdown on socket

allow other threads to shutdown a socket while one is waiting in connect. it can block for a long time if ip of host can not be resolved.