Fix testCompactionPersistence do not cleanup created directory (#3207)