Another try to implement IPv6 support

Hi,

PR #6574 had issues when the GeoIP PECL extension was installed (thus the PR was reverted in #6647).

This is now fixed.

Tested on php53 and php56 with and without the GeoIP PECL extension enabled.
Manually tested with ISP and ORG GeoIP databases.

@tsteur @mattab are there any other test-vector/option to try?