Adjust dependency filter w.r.t. cycles.

A todo item T is shown if there is an uncompleted subtask that does not
point back to T. The latter condition is for handling cycles: a cycle of
two uncompleted tasks both have an uncompleted subtask. Hence, they
wouldn't be printed at all if we would only check the completeness of
subtasks. This is undesired if you look at Example 2 below.

Example 1: consider the following graph, assuming that all tasks are
uncompleted.

(1) -> (2) <-> (3) -> (4)

The filter would only print task (4).

Example 2:

(1) -> (2) <-> (3) -> (4) <-> (5)

The filter would only print tasks (4) and (5). These tasks appear in a
cycle so they're the first things to do. (2) and (3) form another cycle,
but since both of these tasks have an unfinished subtask which is not
part of their cycle, they are not printed.

It is important to run this filter first. In case other filters precede
this one, not all dependencies can be tracked if they were filtered out.