Add helpers to redirect XDG_*_HOME to a temp dir for unit tests
Submitted by Xavier Claessens
Some unit tests may want to write in ~/.cache but does not want to mess up with user's files. In that case the unit test needs to set XDG_CACHE_HOME to /tmp/something.
This gets tricky to cleanup the directory in the case the unit test crash for example. We could profit of the watcher process we fork in gtestdbus.c (see bug #672985) and make that process also cleanup the temp dirs.