Prevent static types of being put multiple times into the .unions_of list after GC.

After a garbage_collection all references to other types are nulled and
restored afterwards to prevent dangling references. For non-static types
this is done exactly once (because of test_memory_reference(t)).
For static types there is no such safeguard, so they could be handled
several times and thus static union types add themselves several times
into the .unions_of list of their head resulting in a circular list.