mkosi: use locale that supports UTF-8, detect one that is available (#8340)
Using C.UTF-8 (as was done before #7244) breaks Arch Linux, but using
en_US.UTF-8 (after #7244) breaks Debian in our .mkosi/mkosi.debian.
So try to detect which one is available and works, first checking
whether we're already running under a valid UTF-8 locale, then trying
C.UTF-8 and finally en_US.UTF-8.
If we fail to find a valid UTF-8 locale, then fail early, instead of
letting the whole build complete only for Mesos to fail midway through
the `ninja test` step.
Tested on all of mkosi.fedora, mkosi.debian and mkosi.arch.
Fixes: #7238