Add common abstract base class for loops

Also: fix alwaysReturnsOrFails() for loops, as execution of
body is not guaranteed.