Generate escape sequences for characters in the query

Fixes https://github.com/sosedoff/pgweb/issues/38

The ```%``` character wasn't getting encoded and an invalid parameter was being passed.