### 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_FAIL_COND_MSG(!tts, "Enable the \"audio/general/text_to_speech\" project setting to use text-to-speech.");
	tts->resume();
}
void DisplayServerWindows::tts_stop() {
	ERR_FAIL_COND_MSG(!tts, "Enable the \"audio/general/text_to_speech\" project setting to use text-to-speech.");
	tts->stop();
}
Error DisplayServerWindows::file_dialog_show(const String &p_title, const String &p_current_directory, const String &p_filename, bool p_show_hidden, FileDialogMode p_mode, const Vector<String> &p_filters, const Callable &p_callback) {
	_THREAD_SAFE_METHOD_
	Vector<Char16String> filter_names;
	Vector<Char16String> filter_exts;
	for (const String &E : p_filters) {
		Vector<String> tokens = E.split(";");
		if (tokens.size() == 2) {
			filter_exts.push_back(tokens[0].strip_edges().utf16());
			filter_names.push_back(tokens[1].strip_edges().utf16());
		} else if (tokens.size() == 1) {
			filter_exts.push_back(tokens[0].strip_edges().utf16());
			filter_names.push_back(tokens[0].strip_edges().utf16());
		}
	}
	Vector<COMDLG_FILTERSPEC> filters;
	for (int i = 0; i < filter_names.size(); i++) {
		filters.push_back({ (LPCWSTR)filter_names[i].ptr(), (LPCWSTR)filter_exts[i].ptr() });
	}
	HRESULT hr = S_OK;
	IFileDialog *pfd = nullptr;
	if (p_mode == FILE_DIALOG_MODE_SAVE_FILE) {
		hr = CoCreateInstance(CLSID_FileSaveDialog, nullptr, CLSCTX_INPROC_SERVER, IID_IFileSaveDialog, (void **)&pfd);
	} else {