Count on task timeouts and task pruning to be idempotent, simplifying handling
code.

Reviewed at https://reviews.apache.org/r/18484/