* **Electron Version**: 4.0.4
* **Operating System** (Platform and Version): MacOS 10.14.3, but it's been reported by my users on Windows and Linux
* **Last known working Electron version** (if applicable): 3.x

Related issue: https://github.com/beakerbrowser/beaker/issues/1333

We started to experience renderer-process freeze-crashes once Beaker was upgraded to v4. When the freeze occurs, the program becomes unresponsive and has to be force-quit.

The freeze only seems to occur when visiting custom stream-protocol resources, and has some randomness to it. The best way I've found to reproduce the issue is to repeatedly refresh a webview which is pointed at a custom stream-protocol resource, which is what I've provided below.

### To Reproduce

https://github.com/pfrazee/electron-bug-webview-freeze

```bash
# Clone this repository
git clone https://github.com/pfrazee/electron-bug-webview-freeze
# Go into the repository
cd electron-bug-webview-freeze
# Install dependencies
npm install
# Run the app
npm start
```

The renderer has a webview embedded with a red border. It is viewing a custom stream-protocol resource (`custom://foo/index.html`).

Once a second, the webview is refreshed. A text-line will inform you of the last refresh time.

Eventually, the renderer process will freeze. It's not always consistent in the amount of time, so you may need to leave it running for a while.
atom/browser/net/url_request_stream_job.cc
status_code = 200;
  }
  std::string status("HTTP/1.1 ");
  status.append(base::IntToString(status_code));
  status.append(" ");
  status.append(
      net::GetHttpReasonPhrase(static_cast<net::HttpStatusCode>(status_code)));
  status.append("\0\0", 2);
  scoped_refptr<net::HttpResponseHeaders> response_headers(
      new net::HttpResponseHeaders(status));
  if (opts.Get("headers", &value)) {
    mate::Converter<net::HttpResponseHeaders*>::FromV8(args->isolate(), value,
                                                       response_headers.get());
  }
  if (!opts.Get("data", &value)) {
    
    value = opts.GetHandle();
  } else if (value->IsNullOrUndefined()) {
    
    
    ended = true;
    base::PostTaskWithTraits(
        FROM_HERE, {content::BrowserThread::IO},
        base::BindOnce(&URLRequestStreamJob::StartAsync, job, nullptr,
                       base::RetainedRef(response_headers), ended, error));
    return;
  }
  mate::Dictionary data(args->isolate(), v8::Local<v8::Object>::Cast(value));
  if (!data.Get("on", &value) || !value->IsFunction() ||
      !data.Get("removeListener", &value) || !value->IsFunction()) {