Undo files and the clipboard data are now saved in the current working directory if $XDG_CACHE_HOME is not available.
If CWD is read-only this does not work, so it would probably make more sense to fallback to the directory that contains the file we are working on, as we can't work anyway if that is read-only.