Issue 1:
Preflight Checklist

I have read the Contributing Guidelines for this project.

I agree to follow the Code of Conduct that this project adheres to.

I have searched the issue tracker for an issue that matches the one I want to file, without success.

Issue Details

Electron Version:

10.1.4

Operating System:

both, macOS 10.14.6 and ArchLinux kernel 5.8.5-arch1-1 (did not test on Windows)

Last Known Working Electron version:

9.3.2

Expected Behavior

Electron quits normally

Actual Behavior

Electron crashes with SIGSEGV

To Reproduce

Here's a minimal code example that crashes electron

const {Worker} = require('worker_threads')
const {app} = require('electron')

const worker_code = `
process.exit(0)
`

app.on('ready', ()=>{
const worker = new Worker(worker_code, {
eval: true
})

worker.on('exit', code=>{
console.log('exited with code', code)
})

setTimeout( ()=>{
app.quit()
}, 1000)
})

Issue 2:
To reproduce: https://gist.github.com/d3b1724eadcc8a605dd5f7230158f05d

Repros for me on 10.1.3, but not current master.

Stack trace:

* thread #1, name = 'CrBrowserMain', queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x18)
* frame #0: 0x000000010656bb93 Electron Framework`node::NodePlatform::AddIsolateFinishedCallback(v8::Isolate*, void (*)(void*), void*) [inlined] std::__1::shared_ptr<node::PerIsolatePlatformData>::operator bool(this=<unavailable>) const at memory:3851:68 [opt]
frame #1: 0x000000010656bb93 Electron Framework`node::NodePlatform::AddIsolateFinishedCallback(this=0x0000000109049c20, isolate=0x0000147000000000, cb=(Electron Framework`node::Environment::AddArrayBufferAllocatorToKeepAliveUntilIsolateDispose(std::__1::shared_ptr<v8::ArrayBuffer::Allocator>)::$_10::__invoke(void*) [inlined] node::Environment::AddArrayBufferAllocatorToKeepAliveUntilIsolateDispose(std::__1::shared_ptr<v8::ArrayBuffer::Allocator>)::$_10::operator()(void*) const at env.cc:1101
Electron Framework`node::Environment::AddArrayBufferAllocatorToKeepAliveUntilIsolateDispose(std::__1::shared_ptr<v8::ArrayBuffer::Allocator>)::$_10::__invoke(void*) at env.cc:1101), data=0x0000000112d3acf0)(void*), void*) at node_platform.cc:355 [opt]
frame #2: 0x00000001064b99c6 Electron Framework`node::Environment::AddArrayBufferAllocatorToKeepAliveUntilIsolateDispose(this=0x0000000108880000, allocator=nullptr) at env.cc:1101:15 [opt]
frame #3: 0x00000001065a209a Electron Framework`node::worker::(anonymous namespace)::SABLifetimePartner::CleanupHook(data=<unavailable>) at sharedarraybuffer_metadata.cc:75:18 [opt]
frame #4: 0x00000001064b58e6 Electron Framework`node::Environment::RunCleanup(this=0x0000000108880000) at env.cc:628:7 [opt]
frame #5: 0x00000001064810be Electron Framework`node::FreeEnvironment(env=0x0000000108880000) at environment.cc:307:8 [opt]
frame #6: 0x0000000100208336 Electron Framework`electron::ElectronBrowserMainParts::PostMainMessageLoopRun() [inlined] std::__1::default_delete<electron::NodeEnvironment>::operator(this=<unavailable>, __ptr=0x00000001090571e0)(electron::NodeEnvironment*) const at memory:2378:5 [opt]
frame #7: 0x000000010020832e Electron Framework`electron::ElectronBrowserMainParts::PostMainMessageLoopRun() [inlined] std::__1::unique_ptr<electron::NodeEnvironment, std::__1::default_delete<electron::NodeEnvironment> >::reset(this=0x0000000109049608, __p=0x0000000000000000) at memory:2633 [opt]
frame #8: 0x000000010020831d Electron Framework`electron::ElectronBrowserMainParts::PostMainMessageLoopRun(this=0x00000001090495c0) at electron_browser_main_parts.cc:555 [opt]
frame #9: 0x0000000101e5e6fe Electron Framework`content::BrowserMainLoop::ShutdownThreadsAndCleanUp(this=<unavailable>) at browser_main_loop.cc:1040:13 [opt]
frame #10: 0x0000000101e60081 Electron Framework`content::BrowserMainRunnerImpl::Shutdown(this=0x0000000109046b00) at browser_main_runner_impl.cc:178:17 [opt]
frame #11: 0x0000000101e5b8cd Electron Framework`content::BrowserMain(parameters=0x00007ffeefbfede8) at browser_main.cc:49:16 [opt]