Fix a BIO leak when verifying SSL certificates or calling get_peer_cert.