Add locale_mutex to prevent race condition within path_locale(), either during initialization or use.