Make sure we always write the sysimg variables to the right module

To maintain compatibility between the MCJIT and non-MCJIT versions,
jl_Module is #defined to the current module of the function builder.
However, this also means that if we're not currently emitting a
function asking for this module is like a game of Russian roulette,
hoping that the last basic block we emitted into happens to be the
right one. This is not super unlikely since while building the
system image we always emit into the shadow module, but we sometimes
(in particular after an unreachable) emit into a BB not associated
with any module. In any case, it's amazing that this has worked for
this long.

Hopefully fixes #8532