Special-case SSL sockets when reading/writing

Calling os.read() or os.write() on an SSLSocket's fileno will read/write
directly from/to the raw socket, without going through the TLS protocol.

Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
Special-case SSL sockets when setting blocking

Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
Catch errors caused by SSL sockets not having data ready

Just because `select()` has returned, doesn't mean the socket has actual
data ready:

https://docs.python.org/2/library/ssl.html#notes-on-non-blocking-sockets

Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
Merge pull request #19 from aanand/fix-tls

Fix TLS