### Preflight Checklist

- [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](https://www.github.com/electron/electron/issues) for a feature request that matches the one I want to file, without success.

### Electron Version

13.0.1

### What operating system are you using?

macOS

### Operating System Version

11.4

### What arch are you using?

arm64 (including Apple Silicon)

### Last Known Working Electron version

12.0.7

### Expected Behavior

Electron shouldn't crash.

### Actual Behavior

Electron crashes.

### Testcase Gist URL

https://gist.github.com/omarkilani/f0c264e278b04575a381d1eadc930514

### Additional Information

Electron 13.x crashes on any geolocation use. Backtrace attached.
shell/browser/electron_browser_main_parts.cc
ElectronBrowserMainParts* ElectronBrowserMainParts::Get() {
  DCHECK(self_);
  return self_;
}
bool ElectronBrowserMainParts::SetExitCode(int code) {
  if (!exit_code_)
    return false;
  content::BrowserMainLoop::GetInstance()->SetResultCode(code);
  *exit_code_ = code;
  return true;
}
int ElectronBrowserMainParts::GetExitCode() const {
  return exit_code_.value_or(content::RESULT_CODE_NORMAL_EXIT);
}
int ElectronBrowserMainParts::PreEarlyInitialization() {
  field_trial_list_ = std::make_unique<base::FieldTrialList>(nullptr);
#if defined(OS_POSIX)
  HandleSIGCHLD();
#endif
  return GetExitCode();
}
void ElectronBrowserMainParts::PostEarlyInitialization() {
  
  
  DCHECK(base::ThreadTaskRunnerHandle::IsSet());
  
  
  js_env_ = std::make_unique<JavascriptEnvironment>(node_bindings_->uv_loop());
  v8::HandleScope scope(js_env_->isolate());