Fixed nondeterministic testDatabaseCloseFlushesCache