Fix rare and unlikely early free

During bootsrap, some code called the generic "map"
triggering compilation of the inference code in
jl_apply_generic -> jl_mt_assoc_by_type ->
cache_method. This particular map method gets
overwritten in the process and by the time
jl_apply_generic gets its function pointer back, it
is not present in the method table anymore.
Then, in jl_trampoline, compilation allocates some
managed memory, sometimes triggering GC, thus
sometimes freeing the function object before it is
called.
fix missing root on module allocation
Merge pull request #7413 from carnaval/master

root module on allocation