In !2051, we switch back to real locale before setting the label text,
however, according to nl_langinfo's manpage, the returned pointer could
be invalid after switching locale or creating new locale, so the program
may crash.
To fix this, we save the result before switching locale, so we won't
access the invalid pointer after switching locale.
The Formats preview tries to find the measurement format of the locale
to preview, and then displays it. However, it displays the text in the
default locale, instead of in the real current locale, as newlocale ()
with base = (locale_t) 0 will use the default locale.
This is fixed by switching back to the real locale before setting the
label text.
Fixes#2458
Part-of: <https://gitlab.gnome.org/GNOME/gnome-control-center/-/merge_requests/2051>