ensure closing of databases is done in tests