GRADLE-2842 Don't schedule tasks that are in the `unknown` state when building the task graph.

These are tasks that have been referenced via a soft dependency but not added to the graph or referenced via a hard dependency.