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...
Oups, I forgot to check back on this sorry.
Agreed, this should be unnecessary and I see you committed a better version already.
I found this one while looking for the other (and collecting garbage on each compilation). It was kind of annoying to track and the main reason I included it in the PR was to avoid having someone spend more time on this some day :-)
Now I don't remember the specifics, but it is easy to trigger by adding a jl_gc_collect call and running bootstrap patiently. The situation is as described in the commit message, i.e., try to compile some method of some function (here ```map``` if I believe my own writings), run inference, override the method in inference.