Fix Py3 support for bytes SQL queries

Fixes #64