If the tempDir is not writable, try the system's global cache dir