Don't use socket.makefile() on Python 2.6

Fix #136