[SPARK-3562]Periodic cleanup event logs

link #2391 
You shouldn't ever need to synchronize on `applications` because it's a read-only variable. It's replaced atomically with a new list (which is why it's volatile) when there are changes. But synchronizing on it doesn't achieve anything.

Your explanation doesn't cover a whole lot of other sources of races when two tasks are running concurrently and looking at the current status of the file system (and potentially modifying it). So yeah, having these tasks run single-threaded would be much more simple to reason about.