Quote range strings when quoting PG ranges

The test case for CVE-2014-3483 doesn't actually send the generated SQL
to the database. The generated SQL is actually invalid for real inputs.
Merge pull request #16021 from sgrif/sg-range-quotes-4-1

Quote range strings when quoting PG ranges (4-1-stable)