root module on allocation

While allocating a module, set_const and module_export can allocate memory so the module must be rooted.
This could be the cause of #6637 but I'm not sure.
I don't think anybody actually ever hit the second one since it is very rare but well...
No problem, I consider this free gdb practice :-)

I looked at it again this morning. It does feel a bit silly to have a bug fix without a proper bug description. I realize I forgot to mention this happens during bootstrap !
I can't seem to reproduce with current master (without the fix), but checkouting an older commit does trigger it again (by adding jl_gc_collect() right before the jl_compile call of the trampoline function and compiling with MEMDEBUG). IMO it is sensitive to bootstrap order.
I don't have time right now for a full investigation but from what I can tell :
- We start inference on map(::Callable, ::(Any,Any)) (in cache_method)
- While running inference (which takes some time so I would say we are also compiling inference code and a lot of things are happening) the method entry we added get overwritten by a guard entry for map(::Callable, ::(Any...))
- The code tries to call the function object which is unrooted and was potentially freed in the meantime

The bootstrap process is still a bit tricky for me so I'm not 100% sure of what should/should not happen there.

I can probably have a deeper look tonight or tomorrow, in the meantime I'm kinda confident that the fix actually fixes the bug, but it would be nice to be sure it can't manifest itself anywhere else.
I used an arbitrary commit from early june to reproduce, I will try and run a bisect later if needed.