The current localdef simply assumes that the locale headers on build system
are compatible with those on the target system which is not necessarily true.
It generally works on FreeBSD (as long as we don't change the locale headers),
but Linux and macOS provide completely different locale headers.
This change is quite ugly and introduces namespacing of the xlocale
structures since many system headers *must* be able to include the "real"
locale headers for printf(), etc., but we also want to access the target
systems's locale structures.