### Godot version

v4.0.3.stable.official [5222a99f5]

### System information

Windows 11, Intel i7-9750H, NVIDIA GeForce RTX 2060 (Driver Version 528.79)

### Issue description



When the window is set to fullscreen, running a project in the debugger will sometimes freeze for several seconds or more.

Freezes appear to last a minimum of 2 to 15 seconds. After that point, clicking the window will cause it to flicker and then resume functioning normally. Tabbing out of the window and then back in can also unfreeze it, possibly faster than just waiting and clicking. The window will not unfreeze if you don't click or tab out.

- The freezes occur a very specific amount of time after the project starts running - almost exactly 0.3 seconds.
- Freezes have an estimated 25-30% chance of occurring.
- The freeze is **not** visual-only, all the program logic will stop and then pick up where it left off when the window unfreezes.
- The `delta` parameter of `_process` does not reflect the freeze. For example, I had a freeze that lasted 20 seconds. There were a handful of frames with high deltas (in the 0.1-0.15 range) but nowhere near 20 seconds.
- Exported versions of projects do not appear to be affected.
- It's not clear if this applies to all projects.
- It's likely windows-only.

Other notes:
- Once, while trying to reproduce this bug, my entire system froze and I had to restart with the power button.
- While preparing my MRP, I deleted icon.svg. This appeared to fix the freezes (somehow). I also started getting the following error, which may be related to the freezing stopping: `load_image: Error opening file 'res://icon.svg'`.
- I restored icon.svg and deleted it again, and after that I couldn't reproduce the bug even after restoring it again. Definitely seems like it's related somehow.
- Exclusive Fullscreen produces the same results.

Edit: Deleting icon.svg in my original project (NOT the MRP) did not fix the issue there (and caused the same load_image error). There are no other svg files in the project, but there are some .png files. May be related to image files in general.

### Steps to reproduce

1) Open the MRP and run it several times, closing if the window doesn't freeze.
2) Generally within about five tries, the freeze will occur.

### Minimal reproduction project

[FullscreenFreeze2.zip](https://github.com/godotengine/godot/files/11537899/FullscreenFreeze2.zip)

register_create_function("windows", create_func, get_rendering_drivers_func);
}
DisplayServerWindows::~DisplayServerWindows() {
	delete joypad;
	touch_state.clear();
	cursors_cache.clear();
	if (mouse_monitor) {
		UnhookWindowsHookEx(mouse_monitor);
	}
	if (user_proc) {
		SetWindowLongPtr(windows[MAIN_WINDOW_ID].hWnd, GWLP_WNDPROC, (LONG_PTR)user_proc);
	}
	
	screen_set_keep_on(false);
#ifdef GLES3_ENABLED
	
	
#endif
	if (windows.has(MAIN_WINDOW_ID)) {
#ifdef VULKAN_ENABLED
		if (context_vulkan) {
			context_vulkan->window_destroy(MAIN_WINDOW_ID);
		}
#endif
		if (wintab_available && windows[MAIN_WINDOW_ID].wtctx) {