Instead of always quoting, implement %q and %Q as sqlite3_mprintf() does.