inference: Fix handling of :throw_undef_if_not (#53875)
This stmt type doesn't usually get introduced until IR conversion, but
we do allow it in inference (to allow it to be emitted by packages like
Diffractor). However, we didn't have a test for it, so the code path
grew a bug. Fix that and also allow this as a frontend form, so it can
be tested without resorting to generated functions.