### Godot version

508a5bf16ea50552c56539da4c96ea13fdf8853e

### System information

Windows 10, Intel i9-11900K

### Issue description

Godot runs fine in the Editor but any test run of a (3D) scene freezes the window up.
Even a test scene with just a single Node3D freezes.

All the test project runs fine with slightly older versions of master / Godot 4.1.

There are no errors but after bisecting it the problem points at changes from pr https://github.com/godotengine/godot/pull/76945 so properly some kind of thread deadlock.

![bisect_result](https://github.com/godotengine/godot/assets/52464204/85442c3c-7df2-43ca-85ef-e555055eec3d)

_edit_

Seems to be caused by ProjectSettings `threading/worker_pool/max_threads` set to 0 and `shader_compiler/shader_cache/enabled`=false

### Steps to reproduce

set ProjectSettings `threading/worker_pool/max_threads` to 0 and `shader_compiler/shader_cache/enabled`=false and testrun a scene from the Editor.

### Minimal reproduction project

[WorkerThreadPoolIssue.zip](https://github.com/godotengine/godot/files/11489032/WorkerThreadPoolIssue.zip)
if (low_priority_task_queue.first()) {
		Task *low_prio_task = low_priority_task_queue.first()->self();
		low_priority_task_queue.remove(low_priority_task_queue.first());
		task_queue.add_last(&low_prio_task->task_elem);
		low_priority_threads_used++;
		return true;
	} else {
		return false;
	}
}
void WorkerThreadPool::_prevent_low_prio_saturation_deadlock() {
	if (low_priority_tasks_awaiting_others == low_priority_tasks_running) {
#ifdef DEV_ENABLED
		print_verbose("WorkerThreadPool: Low-prio slots saturated with tasks all waiting for other low-prio tasks. Attempting to avoid deadlock by scheduling one extra task.");
#endif
		
		
		SelfList<Task> *to_promote = low_priority_task_queue.first();
		if (to_promote) {
			low_priority_task_queue.remove(to_promote);
			task_queue.add_last(to_promote);
			low_priority_threads_used++;
			task_available_semaphore.post();
		}
	}
}
WorkerThreadPool::TaskID WorkerThreadPool::add_native_task(void (*p_func)(void *), void *p_userdata, bool p_high_priority, const String &p_description) {
	return _add_task(Callable(), p_func, p_userdata, nullptr, p_high_priority, p_description);
}
WorkerThreadPool::TaskID WorkerThreadPool::_add_task(const Callable &p_callable, void (*p_func)(void *), void *p_userdata, BaseTemplateUserdata *p_template_userdata, bool p_high_priority, const String &p_description) {