Fix race condition caused by concurrent access to global cache

parent #437 
:+1: Also Might want to use `Path.DirectorySeparatorChar` there instead of '\\'.