Fix race condition when used concurrently
See https://bugs.launchpad.net/snapcraft/+bug/1889741 See https://github.com/goreleaser/goreleaser/issues/1715
If two instances of xdg are running concurrently and a directory does not exist, both will try to create it. The first will typically succeed, but the second will fail as the directory now exists.
This commit removes the race condition by allowing the directory to already exist after the isdir check.
Edited by Tom Payne