Optimize SslHandler

Fixes #1905 

Also did some tweaks related with buffer allocation.

With echo client/server example with SslHandler added, I get about 500% throughput, comparing to the old SslHandler.