Python 3 support for dockerpty

Hi,

the code changes below add full Python 3 support. Sadly I found an issue in Client.attach_socket of the docker-py library.
I created the pull request docker/docker-py#413 to fix this.

All unit tests and integration tests run fine on Python 3.3.2 and Python 2.7.5 for me when patching docker-py with request docker/docker-py#413.

When apliying #27, the travis builds for Python 2.7 also succeed.

Best Regards,
Roman