Appropriately notify Task states on cancellation.

cc> check this over @havocp