rts: Reset STATIC_LINK field of reverted CAFs
When we revert a CAF we must reset the STATIC_LINK field lest the GC
might ignore the CAF (e.g. as it carries the STATIC_FLAG_LIST flag) and
will consequently overlook references to object code that we are trying
to unload. This would result in the reachable object code being
unloaded. See Note [CAF lists] and Note [STATIC_LINK fields].
This fixes Trac #16842.
Idea-due-to: Phuong Trinh <firstname.lastname@example.org>
(cherry picked from commit 2a960c3a04afcfcdb25a13e9a6e65c94c22a169f)