Fix db_format_tsfield() returning value with offset on Postgres 9.2 and later (Bug #1353069)

Change-Id: I827851a16eba74d474234c21dd6b6afc2d06470c
Signed-off-by: Yuliya Bozhko <yuliya.bozhko@totaralms.com>