guard sslengine with a lock to prevent calling wrap and unwrap at the same time
Merge pull request #3411 from eminn/fix/broken-ssl-protocol-maint

[backport] guard sslengine with a lock to prevent calling wrap and unwrap at the sa...