Replace `emitting_small_image` with `jl_cgparam_t` flag
This allows us not to get confused when performing JIT compilation for
the compiler during (strict) pre-compilation of a sysimage. This was
also an issue for our "stackcrumbs" which would include extraneous links
from Core.Compiler.
TODO: add the JSON3 MWE that Jeff was running when he encountered this bug
Co-authored-by: Gabriel Baraldi <baraldigabriel@gmail.com>