Revert "Change os.rename to shutil.move to atomically move the cache_file"

This reverts commit d482a874bde6ccf0531a9a37f4d268437b34bae6.
Change creation of mkstemp to create cache file in /var/tmp

This fixes an issue when /tmp and /var/tmp are on different file
systems.