[Fix #1501] Make sure offenses are printed after infinite loop

Makes it easier to figure out what went wrong.
Merge pull request #1513 from jonas054/1501_infinite_loop_reporting

[Fix #1501] Make sure offenses are printed after infinite loop