### Preflight Checklist

- [X] I have read the [Contributing Guidelines](https://github.com/electron/electron/blob/main/CONTRIBUTING.md) for this project.
- [X] I agree to follow the [Code of Conduct](https://github.com/electron/electron/blob/main/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 bug report that matches the one I want to file, without success.

### Electron Version

17.1.1

### What operating system are you using?

Windows

### Operating System Version

Windows 10 21H2

### What arch are you using?

x64

### Last Known Working Electron version

13.6.9

### Expected Behavior

Assuming a BrowserWindow like this:

```
const mainWindow = new BrowserWindow({
    ...
    webPreferences: {
        nodeIntegration: true,
        contextIsolation: false,
    }
})
```

And an asynchronous filesystem call on `fs.promises` API

```
// renderer.js
const fs = require('fs');
async function asyncStuff() {
    let output = await fs.promises.readFile("datafile");
}
```

Then trying to reload the page when the fs asynchronous call is not finished yet will make the page fail (blank page).

```
// renderer.js
async function testCrash() {
    asyncStuff() // No await here
    window.location.reload() // Here the renderer will crash
})
```

I expect that the page reloads correctly.


### Actual Behavior

The page is blank, and DevTools are disconnected.

### Testcase Gist URL

_No response_

### Additional Information

Notes:
* Replace the `fs.promises.readFile()` by `fs.readFileSync()` and the page will reload fine
* Replace the `fs.promises.readFile()` by `fs.readFile() with callback` and the page will reload fine
* The bug is here also with a `window.location.href`
* I tried with other async api and the page works fine (like `https.get()`, `timers.promises.setTimeout()`, or `fetch()`)

I created a repo to reproduce the bug: https://github.com/remss/electron-issue-reload
Just run `npm i && npm start` then click on `reloadMeWithAsyncStuff` button to see the blank page.
shell/renderer/electron_renderer_client.cc
void ElectronRendererClient::RenderFrameCreated(
    content::RenderFrame* render_frame) {
  new ElectronRenderFrameObserver(render_frame, this);
  RendererClientBase::RenderFrameCreated(render_frame);
}
void ElectronRendererClient::RunScriptsAtDocumentStart(
    content::RenderFrame* render_frame) {
  RendererClientBase::RunScriptsAtDocumentStart(render_frame);
  
  v8::HandleScope handle_scope(v8::Isolate::GetCurrent());
  node::Environment* env = GetEnvironment(render_frame);
  if (env)
    gin_helper::EmitEvent(env->isolate(), env->process_object(),
                          "document-start");
}
void ElectronRendererClient::RunScriptsAtDocumentEnd(
    content::RenderFrame* render_frame) {
  RendererClientBase::RunScriptsAtDocumentEnd(render_frame);
  
  v8::HandleScope handle_scope(v8::Isolate::GetCurrent());
  node::Environment* env = GetEnvironment(render_frame);
  if (env)
    gin_helper::EmitEvent(env->isolate(), env->process_object(),
                          "document-end");
}
void ElectronRendererClient::DidCreateScriptContext(