[Downloads] Do not store error responses during resumption.

If a server or an intermediary sends a redirect, error, or other
unexpected response during resumption, don't store it or discard the
partial download state. Instead the download item will flag itself as
interrupted again and will require an externally initiated Resume() call
to try again.

Such responses are common where captive portals or other middle boxes
are present. If such cases aren't explicitly handled, an untimely
resumption attempt could discard partial state.

As a side-effect of this patch, downloads will also not discard partial
state due to other server errors during resumption (e.g. 500).

BUG=7648
R=svaldez@chromium.org, davidben@chromium.org, rdevlin.cronin@chromium.org
TBR=sky@chromium.org

Review URL: https://codereview.chromium.org/1544603003

Cr-Commit-Position: refs/heads/master@{#376625}
12 files changed