Fixes escapeQuotes method for string with tick and multiple quotes

Method Select.escapeQuotes has a bug. If string contains tick and multiple quotes and ends with quote, the last quote is not appended.

For example, escapeQuotes("Bar \"Rock'n'Roll\"") returns concat("Bar ", '"', "Rock'n'Roll"), but should return concat("Bar ", '"', "Rock'n'Roll", '"')