Add failed database to unit tests tear down function

Fix purging of database files in tear down function during unit tests