### Godot version

v4.0.3.stable.official [5222a99f5]

### System information

Windows 11, AMD Ryzen 5 3500U with Radeon Vega Mobile Gfx     2.10 GHz

### Issue description

  The editor crashes when it is minimised if it isn't the foreground window, eg. via Windows key + M.  This didn't occur in 4.0.2, but is now occurring in 4.0.3. I'll just mention that /interface/editor/save_on_focus_loss is false because another issue mentions something like this but with that property set to true.

### Steps to reproduce

N/A

### Minimal reproduction project

N/A
ERR_FAIL_COND_V(!windows.has(p_window), VK_NULL_HANDLE);
	Window *w = &windows[p_window];
	
	return w->render_pass;
}
VkFramebuffer VulkanContext::window_get_framebuffer(DisplayServer::WindowID p_window) {
	ERR_FAIL_COND_V(!windows.has(p_window), VK_NULL_HANDLE);
	ERR_FAIL_COND_V(!buffers_prepared, VK_NULL_HANDLE);
	Window *w = &windows[p_window];
	
	if (w->swapchain_image_resources != VK_NULL_HANDLE) {
		return w->swapchain_image_resources[w->current_buffer].framebuffer;
	} else {
		return VK_NULL_HANDLE;
	}
}
void VulkanContext::window_destroy(DisplayServer::WindowID p_window_id) {
	ERR_FAIL_COND(!windows.has(p_window_id));
	_clean_up_swap_chain(&windows[p_window_id]);
	for (uint32_t i = 0; i < FRAME_LAG; i++) {
		vkDestroySemaphore(device, windows[p_window_id].image_acquired_semaphores[i], nullptr);
	}
	vkDestroySurfaceKHR(inst, windows[p_window_id].surface, nullptr);
	windows.erase(p_window_id);
}
Error VulkanContext::_clean_up_swap_chain(Window *window) {