Updated CancellationToken usage to throw if cancellation is requested before we start the task.