Protect SQL queries from singleton quotes, brackets etc., keep quoted
terms together.