Fix PostgreSQL unit test to pass with PostgreSQL < 9.0.

The output format for bytea values in PostgreSQL was "escape" until version 9
in which it was changed to "hex", which is what the current tests expect.

Add a version check to make the tests pass with both versions (we could also
set "bytea_output" connection option to "escape", but it seems better to test
the default behaviour).