* Electron version: 1.8.2-beta.3
* Operating system: MacOS 10.12

### Expected behavior

File downloads from custom protocols should complete without issue.

### Actual behavior

Before even triggering the custom protocol handler, the download-item emits 'done' with a state of 'interrupted'. In my demo linked below, I use the new registerStreamProtocol, but I was able to reproduce using registerHttpProtocol as well.

### How to reproduce

Use https://github.com/pfrazee/electron-download-interrupt-bug

atom/browser/net/atom_url_request.cc
bool data_ended = false;
  bool data_transfer_error = false;
  do {
    if (!status.is_success()) {
      response_error = true;
      break;
    }
    if (bytes_read == 0) {
      data_ended = true;
      break;
    }
    if (bytes_read < 0 || !CopyAndPostBuffer(bytes_read)) {
      data_transfer_error = true;
      break;
    }
  } while (
      request_->Read(response_read_buffer_.get(), kBufferSize, &bytes_read));
  if (response_error) {
    DoCancelWithError(net::ErrorToString(status.ToNetError()), false);
  } else if (data_ended) {
    content::BrowserThread::PostTask(
        content::BrowserThread::UI, FROM_HERE,
        base::Bind(&AtomURLRequest::InformDelegateResponseCompleted, this));
    DoTerminate();
  } else if (data_transfer_error) {
    
    DoCancelWithError("Failed to transfer data from IO to UI thread.", false);
  }
}
void AtomURLRequest::OnContextShuttingDown() {