scheduler: Fix inifinite loop for no-wait tasks

When a task run by a DependencyTaskGroup completed immediately (i.e. it
was marked as done right after calling start()), the corresponding entry in
the dependency graph was never removed. As a result the DependencyTaskGroup
would continue running forever (or until it timed out).

Fixes bug #1186389

Change-Id: I9715b54a61d1c3adc22403bc39f8673306bffead