<!--  As an open source project with a dedicated but small maintainer team, it can sometimes take a long time for issues to be addressed so please be patient and we will get back to you as soon as we can.
-->

### Preflight Checklist
<!-- Please ensure you've completed the following steps by replacing [ ] with [x]-->

* [x] I have read the [Contributing Guidelines](https://github.com/electron/electron/blob/master/CONTRIBUTING.md) for this project.
* [X] I agree to follow the [Code of Conduct](https://github.com/electron/electron/blob/master/CODE_OF_CONDUCT.md) that this project adheres to.
* [X] I have searched the issue tracker for an issue that matches the one I want to file, without success.

### Issue Details

* **Electron Version:**
  * 5.0.0
* **Operating System:**
  * macOS 10.14.4
* **Last Known Working Electron version:**:
  * 4.1.4

### Expected Behavior
Quitting while a debugger is attached to the process results in the application exiting without error.

### Actual Behavior
Qutting while a debugger is still attached results in the application crashing and macOS showing its crash report dialog.

### To Reproduce

1. Run electron with `--inspect=9229` or `--inspect-brk=9229`.
2. Attach with a debugger (such as Visual Studio Code).
3. Quit electron without detaching.

Below is a repo that reproduces the issue:
[Repo that reproduces the issue](https://github.com/kpes/electron5attachquitcrash)

```sh
$ git clone https://github.com/kpes/electron5attachquitcrash.git
$ npm install
```

atom/app/node_main.cc
base::ThreadPool::CreateAndStartWithDefaultParams("Electron");
    
    JavascriptEnvironment gin_env(loop);
    
    NodeBindings::RegisterBuiltinModules();
    int exec_argc;
    const char** exec_argv;
    node::Init(&argc, const_cast<const char**>(argv), &exec_argc, &exec_argv);
    node::Environment* env = node::CreateEnvironment(
        node::CreateIsolateData(gin_env.isolate(), loop, gin_env.platform()),
        gin_env.context(), argc, argv, exec_argc, exec_argv);
    
    NodeDebugger node_debugger(env);
    node_debugger.Start();
    mate::Dictionary process(gin_env.isolate(), env->process_object());
#if defined(OS_WIN)
    process.SetMethod("log", &ElectronBindings::Log);
#endif
    process.SetMethod("crash", &ElectronBindings::Crash);
    
    auto reporter = mate::Dictionary::CreateEmpty(gin_env.isolate());
    reporter.SetMethod("start", &crash_reporter::CrashReporter::StartInstance);
    process.Set("crashReporter", reporter);
    mate::Dictionary versions;
    if (process.Get("versions", &versions)) {
      versions.SetReadOnly(ATOM_PROJECT_NAME, ATOM_VERSION_STRING);
    }
    node::LoadEnvironment(env);
    bool more;