[Core] Refactored SSL error handling to SslErrorsHandler.

Also check if the reply dies and perform async handling if it does.

Probably fixes #1804 again.