Improved QueryExpression::escapeString