Fix Segmentation fault: gc_add_root with static thunk.