Fix issue with too extensive useage of file locking.
  -- File locking is only used when module is copied to cache
  -- Add an empty file to the cached module path when copying is done
  -- Use this file instead of the cache directory to check for existence of module in cache
Remove some more locks