At TaskControllerImpl.forceCancel, prevent hard to find bugs by making sure the task is at a valid state.

The operation must be idempotent, given that internally a duplicate cancel request could occur when reverting a service state.