An XDG runtime directory cannot be provided reliably by the shell,
because it's supposed to have the same lifetime as the user's login
session, and the shell doesn't have a reliable way to keep track of that
lifetime. There are probably nonportable ways to get a conforming
directory, such as making a request to PAM, but PAM is supposed to set
XDG_RUNTIME_DIR itself anyway and also doesn't exist on Macs, which I
use most of the time.
My configuration isn't actually using XDG_RUNTIME_DIR anyway, so I don't
want to provide the misleading impression that a runtime directory with
proper behaviour conforming to the specification is definitely
available.