Use TCPSocket.upgradeToSecure() instead of the starttls library.

For Bug 847032 - [email] IMAP only supports initially-SSL encrypted connections, STARTTLS upgrade not supported from unencrypted cleartext.