python3 compatibility

- dict.items().pop() in proc
- str/bytes in backdoor, api_test, ssl_test, test__refcount
- import httplib from six
- PEP-8 fixes