test: ensure closing database