proper cleanup of openssl locking code