Improve the test database cleanup