Fix race condition caused by concurrent access to global cache

parent #437 
We need to check the behavior here on mono.