Cancels the task.
If the task is already running or has already been cancelled, this may have no effect.