Fixes #8210 - Adding caching for smart-proxy puppet classes using Stefan Julin's implementation of cache

Just realized that this will be an issue during multiple concurrent requests to '/environments/blah/classes'. I think synchronizing this whole block is too coarse -- no point for waiting on end of write to a cache file for environment 'A' if we are creating cache for environment 'B'. Might be worth using a file lock: attempt to acquire a lock on a temp file, proceed with an update if acquired, and sleep-wait if not. You can find an example of file locking here: https://github.com/theforeman/smart-proxy/blob/develop/lib/proxy/http_downloads.rb