Fixes PR32129. Test case contributed by Igor Laevsky.
I can't easily think of other ways to safely cache the ASTs. Given
we're going to move to recomputing them in the new PM anyway (unless
there are future plans to not to?), I think it is uncontroversial to
bring the old PM in sync.
If this change is accepted, I'll also delete the code that keeps track
of the Loop->AST mapping. But first I want to know if this change is
acceptable or not.