Added check for task success to state.

refs #5837

In the transfer REST API, incorporated a check on the task exitcode for
asynchronous download of materials for deposit.