fix Issue 9254 - ICE on invalid foreach aggregate

ForeachRangeStatement and WhileStatement are basically replaced into ForStatement in semantic phase.
If any error occurs, they will be left as is, however.

Therefor, `assert(0)` in blockExit, usesEH, comeFrom have the potential to be invoked.