Fixed bugs #2438 and #4496 about quoting of DISTINCT in SELECT clauses