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

This fixes #51
you should remove whitespaces between the dots.