[libvirt] [PATCH] util: Extract locale-related fixes into separate functions