Pass an ip_version to the MaxMind::DB::Writer::Tree::InMemory constructor
A small optimization to avoid rebuilding a Math::Uint128 object repeatedly

This doesn't make much difference, but it's also not much more complicated.

I also renamed a method so it's clearer what it returns.