Close the test database before removing its files

Should fix #2.