Move OpenSSL locking code out of SSLContext