Merge prepared and unprepared tests

Because unprepared queries use the same code path as unprepared
queries now, separate tests are unnecessary.
Support unknown PostgreSQL types as strings
Ensure db is valid at end of tests