Abort loop when cursor is aborted.