Fix for bug #58.
Crash/hang on protocol version negotiation failure. See bug report
for analysis. Now we keep track of handshake failures through the
HANDSHAKE_FAILURE flag and do not call back into SSL_accept/SSL_connect
if handshake had already failed.