The libarchive APIs use nl_langinfo(CODESET) for iconv so they need the
locale to be set for LC_CTYPE. However, the rest of CMake does not
define any behavior for non-ASCII character classification/conversion so
we do not want to setlocale() globally. Add a RAII class to save, set,
and restore the locale around calls to libarchive APIs.
Inspired-by: Clinton Stimpson <clinton@elemtech.com>