Detect and handle non-existing tasks more explicitly.

Return NULL for non-existing tasks on fetch since nulls are already used
in the task tree for INVALID tasks.

Change-Id: I37ca30eec59d27f2a2505bd0a6246cec63142e07
7 files changed