This patch cleans up libcxx's usage of newlocale, freelocale, uselocale, and locale_t.
First, libcxx no longer defines the posix newlocale, freelocale, uselocale, and locale_t names on non-posix compliant systems. Those names don't belong to libcxx, so _libcpp variants and forwarders have been created. The renaming is the bulk of the diff.
Second, improved locale management RAII objects have been created and used. _locale_raii was a typedef for a unique_ptr with a function pointer deleter. That requires a fatter object and an indirect call. Instead, a small, custom RAII object was added to manage the switching of locales with uselocale. This also allows for a terser syntax. An RAII object for the newlocale / freelocale pair was also created, as was a fancier RAII object to handle the case when we are handed a locale that (maybe) isn't supposed to be deleted.
The last significant change is that the nop_locale_mgmt's newlocale (used by newlib) will now attempt to support the "C" and "POSIX" locales, rather than return 0.
Tested on Linux x64, and on an embedded target that also happens to use all the trivial locale wrappers (like nop_locale_mgmt).