Modified SafeCancellationTokenSource to allow running on same thread.