Recycle test databases
Created by: camdencheek
Creating a new database with every call to NewDB() was putting a lot of contention on postgres system tables. In slower environments like CI, this was causing the tests to time out even though it allowed for much faster tests locally. This commit adds test database recycling, in which tests try to pass their database on to another test before destroying it.
This should hopefully fix the timeouts in CI when running the database tests. (Thanks for pointing these out @eseliger!)