Fix for ssl do_handshake exceptions with immediately closed connections.

Add check of SSL socket's _connected attribute when testing for a closed
socket.  Reproducable with "nmap -p <serverport>".