Fix bug: a relatively rare circumstance was causing linked variables
to become unlinked. Specifically:
1. Load compiled code that creates a cache to variable A.
2. Link variable B to variable C.
3. Link variable B to variable A.
After step (3), variable C was no longer linked to variable B,
although B and A were still linked. The problem is that step (3)
overwrites the cache in B with the cache in A, but C is unchanged.
This has been fixed by leaving a forwarding link in the "old" cache
and snapping the link on reference. Any outstanding copies of the
"old" cache, such as that in C, are updated to point to the "new"
cache the next time they're referenced.