Fixed deadlock race condition by locking access around non-threadsafe method ResourceManager.GetResourceSet