get_locale_time(): Fix locking of localtime()