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

...me time