Repository: godot
Issue: Engine and/or entire computer crashes when resizing the game window and `rendering/driver/threads/thread_model` = `Multi-Threaded`
Labels: bug,topic:rendering,confirmed,crash

### Godot version

v4.0.alpha.custom_build [61f045245]

### System information

Arch Linux x86_64, Kernel 5.15.61-1-lts, AMD RX 6800 XT, Mesa 22.1.6, Plasma 5.25.4, KWin+X11

### Issue description

Similar to https://github.com/godotengine/godot/issues/58606

```
================================================================
handle_crash: Program crashed with signal 11
Engine version: Godot Engine v4.0.alpha.custom_build (61f045245fbdf260245555bdf5be46f720daee01)
Dumping the backtrace. Please include this when reporting the bug on: https://github.com/godotengine/godot/issues
[1] /usr/lib/libc.so.6(+0x38a40) [0x7f4c9c4f8a40] (??:0)
[2] /usr/lib/amdvlkpro64.so(+0xfd045c) [0x7f4c81e6a45c] (??:0)
[3] /usr/lib/amdvlkpro64.so(+0x11ee779) [0x7f4c82088779] (??:0)
[4] /usr/lib/amdvlkpro64.so(+0x12860b3) [0x7f4c821200b3] (??:0)
[5] VulkanContext::swap_buffers() (??:0)
[6] RenderingDeviceVulkan::swap_buffers() (??:0)
[7] RendererCompositorRD::end_frame(bool) (??:0)
[8] RenderingServerDefault::_draw(bool, double) (??:0)
[9] RenderingServerDefault::_thread_draw(bool, double) (??:0)
[10] CommandQueueMT::Command2<RenderingServerDefault, void (RenderingServerDefault::*)(bool, double), bool, double>::call() (??:0)
[11] CommandQueueMT::_flush() (??:0)
[12] CommandQueueMT::wait_and_flush() (??:0)
[13] RenderingServerDefault::_thread_loop() (??:0)
[14] RenderingServerDefault::_thread_callback(void*) (??:0)
[15] Thread::callback(Thread*, Thread::Settings const&, void (*)(void*), void*) (??:0)
[16] void std::__invoke_impl<void, void (*)(Thread*, Thread::Settings const&, void (*)(void*), void*), Thread*, Thread::Settings, void (*)(void*), void*>(std::__invoke_other, void (*&&)(Thread*, Thread::Settings const&, void (*)(void*), void*), Thread*&&, Thread::Settings&&, void (*&&)(void*), void*&&) (??:0)
[17] std::__invoke_result<void (*)(Thread*, Thread::Settings const&, void (*)(void*), void*), Thread*, Thread::Settings, void (*)(void*), void*>::type std::__invoke<void (*)(Thread*, Thread::Settings const&, void (*)(void*), void*), Thread*, Thread::Settings, void (*)(void*), void*>(void (*&&)(Thread*, Thread::Settings const&, void (*)(void*), void*), Thread*&&, Thread::Settings&&, void (*&&)(void*), void*&&) (??:0)
[18] void std::thread::_Invoker<std::tuple<void (*)(Thread*, Thread::Settings const&, void (*)(void*), void*), Thread*, Thread::Settings, void (*)(void*), void*> >::_M_invoke<0ul, 1ul, 2ul, 3ul, 4ul>(std::_Index_tuple<0ul, 1ul, 2ul, 3ul, 4ul>) (??:0)
[19] std::thread::_Invoker<std::tuple<void (*)(Thread*, Thread::Settings const&, void (*)(void*), void*), Thread*, Thread::Settings, void (*)(void*), void*> >::operator()() (??:0)
[20] std::thread::_State_impl<std::thread::_Invoker<std::tuple<void (*)(Thread*, Thread::Settings const&, void (*)(void*), void*), Thread*, Thread::Settings, void (*)(void*), void*> > >::_M_run() (??:0)
[21] /usr/lib/libstdc++.so.6(+0xd62f3) [0x7f4c9c8872f3] (??:0)
[22] /usr/lib/libc.so.6(+0x8678d) [0x7f4c9c54678d] (??:0)
[23] /usr/lib/libc.so.6(__clone+0x44) [0x7f4c9c5c78e4] (??:0)
-- END OF BACKTRACE --
================================================================
```

### Steps to reproduce

1) Run MRP
2) Resize window

### Minimal reproduction project

[empty.zip](https://github.com/godotengine/godot/files/9399389/empty.zip)