ip.py: support both pygeoip 0.3.0 and older versions.