Fix package precompilation (PrecompileTools) (#57828)
With the "classic" inference timing disabled, PrecompileTools and
SnoopCompile are non-functional on 1.12 & master. #57074 added timing
data to the CodeInstances themselves, which should help restore
SnoopCompile. However, without the tree structure provided by the old
inference timing system, we still need a way to tag MethodInstances that
get inferred inside `PrecompileTools.@compile_workload` blocks.
This adds a simple mechanism modeled after `@trace_compile` that
switches to tagging MethodInstances in `jl_push_newly_inferred`.
https://github.com/JuliaLang/PrecompileTools.jl/pull/47 contains (or
will contain) the corresponding changes to PrecompileTools.jl.