[#989] Fix possible deeadlock on close in SslHandler