Use dict as Table cache.

For both IPv4 and IPv6, use a dict instead of a weakref cache. This
makes the cache a permanent one, and avoids the overhead of
creating/freeing tables too often.