<!--
Thanks for opening an issue! A few things to keep in mind:

- The issue tracker is only for bugs and feature requests.
- Before reporting a bug, please try reproducing your issue against
  the latest version of Electron.
- If you need general advice, join our Slack: http://atom-slack.herokuapp.com
-->

* Electron version: 1.6.7
* Operating system: macOS

### Expected behavior

No crashes using custom protocol

### Actual behavior

Crash on IO thread:

```
Thread 14 Crashed:: Chrome_IOThread
0   libnet.dylib                  	0x0000000115145fb0 net::URLRequestJob::ReadRawDataComplete(int) + 128
1   com.github.electron.framework 	0x000000010d04af80 atom::URLRequestFetchJob::OnURLFetchComplete(net::URLFetcher const*) + 192 (url_request_fetch_job.cc:262)
2   libbase.dylib                 	0x000000010ffb3591 base::debug::TaskAnnotator::RunTask(char const*, base::PendingTask*) + 225
3   libbase.dylib                 	0x000000010ffe19e6 base::MessageLoop::RunTask(base::PendingTask*) + 390
4   libbase.dylib                 	0x000000010ffe1cbc base::MessageLoop::DeferOrRunPendingTask(base::PendingTask) + 44
5   libbase.dylib                 	0x000000010ffe2073 base::MessageLoop::DoWork() + 371
6   libbase.dylib                 	0x000000010ffe4185 base::MessagePumpLibevent::Run(base::MessagePump::Delegate*) + 245
7   libbase.dylib                 	0x000000010ffe174e base::MessageLoop::RunHandler() + 94
8   libbase.dylib                 	0x0000000110009503 base::RunLoop::Run() + 115
9   libcontent.dylib              	0x0000000112b0f748 content::BrowserThreadImpl::IOThreadRun(base::RunLoop*) + 24
10  libcontent.dylib              	0x0000000112b0f8d6 content::BrowserThreadImpl::Run(base::RunLoop*) + 294
11  libbase.dylib                 	0x000000011003dec2 base::Thread::ThreadMain() + 386
12  libbase.dylib                 	0x0000000110036a57 0x10ffa4000 + 600663
13  libsystem_pthread.dylib       	0x00007fffc8d1a9af _pthread_body + 180
14  libsystem_pthread.dylib       	0x00007fffc8d1a8fb _pthread_start + 286
15  libsystem_pthread.dylib       	0x00007fffc8d1a101 thread_start + 13
```

### How to reproduce

#### index.js

```js
const {app, protocol, BrowserWindow} = require('electron')

let mainWindow

app.once('ready', () => {
  protocol.registerHttpProtocol('test', (request, callback) => {
    callback({url: 'https://cure53.de'})
  })

  mainWindow = new BrowserWindow()
  mainWindow.loadURL(`file://${__dirname}/index.html`)
})
```

#### index.html

```html
<iframe src="test://whatever"></iframe>
```
atom/browser/net/url_request_fetch_job.cc
net::URLFetcher::RequestType request_type;
  if (method.empty())
    request_type = GetRequestType(request()->method());
  else
    request_type = GetRequestType(method);
  fetcher_ = net::URLFetcher::Create(formated_url, request_type, this);
  fetcher_->SaveResponseWithWriter(base::WrapUnique(new ResponsePiper(this)));
  
  if (url_request_context_getter_)
    fetcher_->SetRequestContext(url_request_context_getter_.get());
  else
    fetcher_->SetRequestContext(request_context_getter());
  
  if (referrer.empty())
    fetcher_->SetReferrer(request()->referrer());
  else
    fetcher_->SetReferrer(referrer);
  
  if (upload_data && request_type == net::URLFetcher::POST) {
    std::string content_type, data;
    upload_data->GetString("contentType", &content_type);
    upload_data->GetString("data", &data);
    fetcher_->SetUploadData(content_type, data);
  }
  
  fetcher_->SetExtraRequestHeaders(
      request()->extra_request_headers().ToString());
  fetcher_->Start();
}
void URLRequestFetchJob::HeadersCompleted() {