KEY-56 - Checkout do_ssl_handshake error and close if fatal

Previously, the first call to do_ssl_handshake was assume to 'work'
(i.e. return SSL_NEED_READ or SSL_NEED_WRITE) and the error code
was not checked. Added checking of the error code and if it is not
retriable then drop the connection and log the error.