Check there is a region name before trying to set it in the hash

This is another attempt at this fix: https://github.com/mtodd/geoip/pull/7

The test case added previously segfaulted for me.