Add GC root for func in jl_instantiate_staged

Fixes #9099, I hope. CC @Keno, @JeffBezanson, @vtjnash. With this change, I was able to insert a `jl_gc_collect()` [here](https://github.com/JuliaLang/julia/blob/6ad8410abe3d9fa4b54e6844daa67a4d8a3b5762/src/gf.c#L978) without causing a segfault.