Adoption cache should use WeakValueDictionary.
Adoption cache should use WeakValueDictionary.

We use a cache to preserve sharing-by-reference relationships when
"adopting" outside modules into a new top-level functional module
context (adoption occurs frequently when using advanced config systems
like gin or fiddle, or during interactive development).

Previously we were careful not to hold references to Scope objects by
having the cache itself be a WeakKeyDictionary, however the scope-keyed
entries were just classic dicts, and this was leading to leaks of
tracers and arrays ultimately due to long-lived references to submodule
objects.  By using a WeakValueDictionary to refer to these we avoid
these lifetime issues.

google/flax,google/flax