tls: handle SSL_ERROR_ZERO_RETURN

see #5004