use `inferencebarrier` instead of `invokelatest` for 1-arg `@assert` (#55783)
This version would be better as per this comment:
<https://github.com/JuliaLang/julia/pull/55739#pullrequestreview-2304360447>
I confirmed this still allows us to avoid invalidations reported at
JuliaLang/julia#55583.