### Godot version

4.2 031aa99

### System information

Windows 10.0.19045 - Vulkan (Forward+) - dedicated NVIDIA GeForce GTX 1060 (NVIDIA; 30.0.15.1403) - Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz (8 Threads)

### Issue description

When opening any project on the current master I'm randomly getting this crash:
```
CrashHandlerException: Program crashed
Engine version: Godot Engine v4.2.dev.custom_build (031aa99d313ceec7cdb8263957d22cae10de0b95)
Dumping the backtrace. Please include this when reporting the bug to the project developer.
[0] mtx_do_lock (D:\a\_work\1\s\src\vctools\crt\github\stl\src\mutex.cpp:91)
[1] std::_Mutex_base::lock (C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\mutex:50)
[2] std::unique_lock<std::recursive_mutex>::unique_lock<std::recursive_mutex> (C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\mutex:134)
[3] MutexLock<MutexImpl<std::recursive_mutex> >::MutexLock<MutexImpl<std::recursive_mutex> > (C:\godot_source\core\os\mutex.h:122)
[4] ResourceImporterTexture::update_imports (C:\godot_source\editor\import\resource_importer_texture.cpp:93)
[5] EditorNode::_notification (C:\godot_source\editor\editor_node.cpp:584)
[6] EditorNode::_notificationv (C:\godot_source\editor\editor_node.h:118)
[7] Object::notification (C:\godot_source\core\object\object.cpp:800)
[8] SceneTree::_process_group (C:\godot_source\scene\main\scene_tree.cpp:951)
[9] SceneTree::_process (C:\godot_source\scene\main\scene_tree.cpp:1028)
[10] SceneTree::process (C:\godot_source\scene\main\scene_tree.cpp:510)
[11] Main::iteration (C:\godot_source\main\main.cpp:3434)
[12] OS_Windows::run (C:\godot_source\platform\windows\os_windows.cpp:1479)
[13] widechar_main (C:\godot_source\platform\windows\godot_windows.cpp:182)
[14] _main (C:\godot_source\platform\windows\godot_windows.cpp:204)
[15] main (C:\godot_source\platform\windows\godot_windows.cpp:218)
[16] WinMain (C:\godot_source\platform\windows\godot_windows.cpp:232)
[17] __scrt_common_main_seh (D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288)
[18] <couldn't map PC to fn name>
```
It happens quite often actually, like once in 3 or 4 runs.

### Steps to reproduce

1. Open a project

### Minimal reproduction project

Doesn't seem project-specific.
Ref<Image> editor_image;
	bool import_editor_image = use_editor_scale || convert_editor_colors;
	if (import_editor_image) {
		float editor_scale = scale;
		if (use_editor_scale) {
			editor_scale = scale * EDSCALE;
		}
		int32_t editor_loader_flags = loader_flags;
		if (convert_editor_colors) {
			editor_loader_flags |= ImageFormatLoader::FLAG_CONVERT_COLORS;
		}
		editor_image.instantiate();
		err = ImageLoader::load_image(p_source_file, editor_image, nullptr, editor_loader_flags, editor_scale);
		if (err != OK) {
			WARN_PRINT("Failed to import an image resource for editor use from '" + p_source_file + "'");
		} else {
			images_imported.push_back(editor_image);
		}
	}
	for (Ref<Image> &target_image : images_imported) {
		
		if (size_limit > 0 && (target_image->get_width() > size_limit || target_image->get_height() > size_limit)) {
			if (target_image->get_width() >= target_image->get_height()) {
				int new_width = size_limit;
				int new_height = target_image->get_height() * new_width / target_image->get_width();
				target_image->resize(new_width, new_height, Image::INTERPOLATE_CUBIC);
			} else {
				int new_height = size_limit;
				int new_width = target_image->get_width() * new_height / target_image->get_height();