### 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)
bool process_on_calling_thread = threads.size() == 0;
	if (process_on_calling_thread) {
		_process_task(p_task);
		return;
	}
	task_mutex.lock();
	p_task->low_priority = !p_high_priority;
	if (!p_high_priority && use_native_low_priority_threads) {
		p_task->low_priority_thread = native_thread_allocator.alloc();
		task_mutex.unlock();
		if (p_task->group) {
			p_task->group->low_priority_native_tasks.push_back(p_task);
		}
		p_task->low_priority_thread->start(_native_low_priority_thread_function, p_task); 
	} else if (p_high_priority || low_priority_threads_used < max_low_priority_threads) {
		task_queue.add_last(&p_task->task_elem);
		if (!p_high_priority) {
			low_priority_threads_used++;
		}
		task_mutex.unlock();
		task_available_semaphore.post();
	} else {
		
		low_priority_task_queue.add_last(&p_task->task_elem);
		task_mutex.unlock();
	}
}
bool WorkerThreadPool::_try_promote_low_priority_task() {