SI-7150 Replace scala.reflect.internal.WeakHashSet

Replaces scala.reflect.internal.WeakHashSet with a version that
* extends the mutable.Set trait
* doesn't leak WeakReferences
* is unit tested
SI-7149 Use a WeakHashSet for type uniqueness

Currently type uniqueness is done via a HashSet of WeakReferences, but
that means the WeakReferences live through an entire compile session.
This commit uses a WeakHashSet instead so that the WeakReferences are
cleaned up when no longer in use.
Modify perRunCaches to not leak WeakReferences

perRunCaches was using a HashMap of WeakReferences which meant it would
accumulate WeakReferences over time. This commit uses a WeakHashSet
instead so that the references are cleaned up.