check for lock creation errors
remove the cache file if something bad happens