Also report errors which occurred during creation of the SSL handle.
Protect the OpenSSL handle with a mutex to prevent messing up its state.
Even better error handling (fetching the correct error, handling syscall
errors right, etc.)