Trim hash map size when pruning type caches (#53296)
This doesn't make much of a difference for the smaller type caches (many
of which have exactly 1 element actually), but it does offer up to ~75%
savings (8192 -> 2048, 4096 -> 512) for some of the larger type caches
in our sysimage.