Fixed upload cancel race condition.

Previously, during a cancellation, it was unclear whether the callback
would be triggered by the progress function or the enclosing upload
function. Now it does not matter, since they both trigger the callback
with the same data.