Add GC root for func in jl_instantiate_staged

Fixes #9099
Merge pull request #9111 from JuliaLang/teh/staged_root

Add GC root for func in jl_instantiate_staged