Check if current dir is writable and if not try the cache dir from settings