* Electron version: 1.6.1
* Operating system: macOS 10.12.3, Windows 7 64bit

### Expected behavior

Should emit an error on the request object.

### Actual behavior

<img width="420" alt="image" src="https://cloud.githubusercontent.com/assets/99662/23713890/4e9b8f52-041f-11e7-9dfb-e8408bb58670.png">

An uncatchable error happens.

### How to reproduce
```bash
git clone https://github.com/arantes555/electron-net-encoding-testcase.git
cd electron-net-encoding-testcase
npm install
npm start
```

atom/browser/net/atom_url_request.cc
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
  content::BrowserThread::PostTask(
      content::BrowserThread::IO, FROM_HERE,
      base::Bind(&AtomURLRequest::DoSetLoadFlags, this, flags));
}
void AtomURLRequest::DoWriteBuffer(
    scoped_refptr<const net::IOBufferWithSize> buffer,
    bool is_last) {
  DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
  if (!request_) {
    return;
  }
  if (is_chunked_upload_) {
    
    bool first_call = false;
    if (!chunked_stream_writer_) {
      std::unique_ptr<net::ChunkedUploadDataStream> chunked_stream(
          new net::ChunkedUploadDataStream(0));
      chunked_stream_writer_ = chunked_stream->CreateWriter();
      request_->set_upload(std::move(chunked_stream));
      first_call = true;