Optimize select_value, select_values, select_rows and dry up checking whether to exec with cache for Postgresql adapter

Reduces creating unused objects, with the most dramatic reduction in select_values which used to map(&:first) an array of single element arrays.
Merge pull request #14790 from krisselden/optimize-postgres-selects

Optimize select_value, select_values, select_rows in Postgresql adapter.