Fixing race condition in file cleaner