Python 3 fixes

I've written some changes that allow me to run Celery (master branch) worker in py3.4 env.
This was mentioned here https://github.com/celery/py-amqp/issues/46 as well.

It also shouldn't break anything with py2 as long as `str()` (not `unicode`) was used
This doesn't seem right? Why is StringIO pointing to BytesIO?