test: set HOME like XDG_DATA_DIR
Darwin platforms are not using XDG_DATA_DIR, and will use the content of HOME instead to create files.
Fixes #28343 (closed)
I'm not a big fan of this solution since it would solve for Darwin, but then Windows will probably get the same issue when we port the tests there.