libintl: Improve locale handling on macOS 10.12 or newer.
* gettext-runtime/intl/langprefs.c (_nl_language_preferences_default): Make the
logic also work in locales such as "zh-Hans-DE".
* gettext-runtime/intl/setlocale.c: Include header files for CoreFoundation.
(libintl_setlocale): Try harder to set a locale for categories LC_CTYPE and
LC_MESSAGES.