Fix error handling in SSL_CTX_new