Guard against infinite loops.
Guard against infinite loops.

The limit of 1000 iterations seems appropriate, as this is python's
default maximum recursion depth.

Furthermore, no message in reality will contain more than 1000 items
corresponding to one iteration, not even in the innermost loops.

@sebschrader estimated that in most cases most loops should just run
once or twice.

agdsn/hades,agdsn/hades,agdsn/hades,agdsn/hades,agdsn/hades