This uses the same utility function that mosh-client/mosh-server do. This resolves portability issues with the 'locale' command. This fixes OpenBSD 6.0 and probably Haiku builds.