Prevent type infer hang of "simple" recursive functions (#58273)
Prevent infinite inference when dealing with LimitedAccuracy by
declining to cache them. Presence in the cache triggers further
compilation to resolve it, so removing infinite work from the cache also
prevents infinite work at pre-compile/jit compile time.
Fix #57098
Fix #57873