Catch wrapped SocketExceptions when SslStream.Write is being used.