Fix race condition caused by concurrent access to global cache

parent #437 
No, it cannot be an else condition to the previous `if`. Please read my comments above `File.Delete` and you will see a case where, after `File.Delete` executes successfully, the file still exists. The basic idea is: if process A opened a file with `FileShare.Delete`, process B can successfully perform `File.Delete` on that file even it's still open. However, the file won't be actually deleted until process A close the handle to it.