Add test for pgsql output.

This includes cloning the output, and turned up a couple of bugs
with initialising `table_t` as a copy.
Merge pull request #8 from MapQuest/mla_threadpend_tests

Add test for pgsql output.