pyopenssl: fix WantReadError when using a timeout
pyopenssl: fix WantReadError when using a timeout

Fixes the issues mentioned in kennethreitz/requests#749

Prevent WantReadError by using a fileobject which correctly handles those.
socket._fileobject which was previously used only handled builtin `EINTR` which
are is the corresponding error from the stdlib to WantReadError.
The new implementation inherits from socket._fileobject overwriting read() and
readline(). The overwritten methods are taken straight from CPython 2.7.5 and
modified as follows in the relevant places:

```
-except error, e:
-    if e.args[0] == EINTR:
-        continue
-    raise
+except OpenSSL.SSL.WantReadError:
+    continue
```

urllib3 itself only needs `readline()` overwritten, but requests also needs
`read()`.
The handshake could have been handled automatically by writes and reads, but
when requesting the certificate directly after connection setup an error is
thrown.

Geoion/urllib3,sileht/urllib3,luca3m/urllib3,matejcik/urllib3,Lukasa/urllib3,gardner/urllib3,urllib3/urllib3,mikelambert/urllib3,denim2x/urllib3,sigmavirus24/urllib3,sornars/urllib3,msabramo/urllib3,luca3m/urllib3,sileht/urllib3,boyxuper/urllib3,asmeurer/urllib3,boyxuper/urllib3,urllib3/urllib3,asmeurer/urllib3,mikelambert/urllib3,gardner/urllib3,sornars/urllib3,msabramo/urllib3,haikuginger/urllib3,Disassem/urllib3,tutumcloud/urllib3,denim2x/urllib3,silveringsea/urllib3,matejcik/urllib3,sigmavirus24/urllib3,tutumcloud/urllib3,Lukasa/urllib3,silveringsea/urllib3,haikuginger/urllib3,Geoion/urllib3,Disassem/urllib3