allow multiple cursors to run at once

A cursor now inspects the handled field to see if it got locked by
another cursor.

Using multiple cursors is inefficient: they will both try to lock a
record at the same time.
So ideally you should use just one cursor,
However, it can be more convenient to use one cursor per-process and run 2
processes for redundancy/failover.