locale: Support distributions without locale-gen.

If /etc/locale.gen (or the configured localeGenPath) does not exist,
assume that all the supported languages are already built into the
locale archive, and retrieve the list from "locale -a".

The list will then contain lines with only the locale rather than
locale + space + encoding, but that should not affect any of the rest of
the code. UTF-8 locales will still contain the string "UTF-8" (as part
of the ".UTF-8" suffix), we will not write a locale.gen file if we don't
have locale-gen, and everything else just strips away the encoding.