gcc50: Change c++ locale handling
The biggest change is removing the modification of the specified locale.
Before locales without extensions were appended with ".UTF-8" and
modifiers (e.g. @euro) were silently stripped off.
The latter is probably a bad idea, and even if we want to continue doing
this (modifiers are not supported), it should be done at the library
level, not at c++ on gcc level. The no-extension problem has been solved
today by creating symlinks at /usr/share/locale.
The logic of the "gnu" support was mimicked by using newlocale, duplocale,
and freelocale. The generic version uses setlocale only. This patch will
be pushed upstream most likely.