### 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
ERR_MAIN_THREAD_GUARD;
	content_scale_mode = p_mode;
	_update_viewport_size();
}
Window::ContentScaleMode Window::get_content_scale_mode() const {
	ERR_READ_THREAD_GUARD_V(CONTENT_SCALE_MODE_DISABLED);
	return content_scale_mode;
}
void Window::set_content_scale_aspect(ContentScaleAspect p_aspect) {
	ERR_MAIN_THREAD_GUARD;
	content_scale_aspect = p_aspect;
	_update_viewport_size();
}
Window::ContentScaleAspect Window::get_content_scale_aspect() const {
	ERR_READ_THREAD_GUARD_V(CONTENT_SCALE_ASPECT_IGNORE);
	return content_scale_aspect;
}
void Window::set_content_scale_factor(real_t p_factor) {
	ERR_MAIN_THREAD_GUARD;
	ERR_FAIL_COND(p_factor <= 0);
	content_scale_factor = p_factor;
	_update_viewport_size();
}
real_t Window::get_content_scale_factor() const {
	ERR_READ_THREAD_GUARD_V(0);
	return content_scale_factor;
}
void Window::set_use_font_oversampling(bool p_oversampling) {