### Godot version

2992ffd25523cb8b3e0ef1b873c40115b8940178

### System information

Windows 10

### Issue description

Godot crashes randomly within a few seconds after project start when moving with the mouse.

![win_err](https://github.com/godotengine/godot/assets/52464204/1da28596-d95b-40f3-b32f-12219ec02c5d)

Started after recent merge of https://github.com/godotengine/godot/pull/67791.
I can confirm that reverting the pr fixes the crashes.

### Steps to reproduce

see desc

### Minimal reproduction project

N/A
if (monitor_info->x != monitors[p_screen].x || monitor_info->y != monitors[p_screen].y) { 
					continue;
				}
				if (monitor_info->mode != None) {
					current_mode = monitor_info->mode;
					found_active_mode = true;
					break;
				}
			}
			if (found_active_mode) {
				for (int mode = 0; mode < screen_info->nmode; mode++) {
					XRRModeInfo m_info = screen_info->modes[mode];
					if (m_info.id == current_mode) {
						
						return Math::snapped((float)m_info.dotClock / ((float)m_info.hTotal * (float)m_info.vTotal), 0.01);
					}
				}
			}
			ERR_PRINT("An error occurred while trying to get the screen refresh rate."); 
			return SCREEN_REFRESH_RATE_FALLBACK;
		} else {
			ERR_PRINT("An error occurred while trying to get the screen refresh rate.");
			return SCREEN_REFRESH_RATE_FALLBACK;
		}
	}
	ERR_PRINT("An error occurred while trying to get the screen refresh rate.");
	return SCREEN_REFRESH_RATE_FALLBACK;
}
#ifdef DBUS_ENABLED
void DisplayServerX11::screen_set_keep_on(bool p_enable) {