Fix query parameter processing to more correctly match PostgreSQL's lexer
Parameter substitution processing: if we detect multiple statements in a query that is not allowed, quit immediately. Also improve readability.
Parameter substitution processing: fix a small bug in dollar quoted string processing.
Parameter substitution processing: don't touch output parameters.