Encode to binary before writing with OpenSSL::SSL::SSLSocket

This PR should fix MacRuby/MacRuby#188. The problem is `Net::IMAP` sends  the content length in bytes to imap server, but `OpenSSL::SSL:SSLSocket#print` computes the content length in characters. That is why the patch sends the length in characters in the issue works.

The same fix in `OpenSSL::Buffering` is in MRI 1.9.3 or above.