Fix potential resource leak in SslHandler

- Fixes: #1116