Allow network operations to cancel

There is currently no way to cancel a clone operation in progress.  This PR changes the signature of the network-transfer progress callback so that it can cancel the transfer by returning a non-zero value. This also allows cancellation of a fetch.

Fixes #1310.