SI-7149 Use a WeakHashSet for type uniqueness

We have an implementation of WeakHashSet in the compiler but it never cleans up its WeakReferences. The first commit in this PR replaces the implementation with one that does clean up. Along the way it modifies the interface to follow the standard scala.collection.mutable.Set interface so that it can eventually be moved into the main library should we choose to do so.

Currently type uniqueness is done via a HashSet of WeakReferences, but
that means the WeakReferences live through an entire compile session.
Another commit uses the weak has WeakHashSet instead so that the WeakReferences are
cleaned up when no longer in use.

Finally, perRunCaches is also updated to use the WeakHashSet instead of a HashSet of WeakReferences.