Allow creating a hash map with known size.

In the case when the number of elements is known, this makes the
creation of the hash map about twice as fast due that we don't need to
grow.