Add safety check when accessing NSLocaleCountryCode.

Some region formats (like Esperanto) lack a country code and return nil
instead, so they can’t be set as a value in a dictionary.