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...
OK. With this fix only in the slow path, there seems to be no reason to remove it.
It seems wrong for guard entries to overwrite anything. That might need to be changed but for now I'll leave it alone.