### Godot version

4.0.1(flatpak)

### System information

Linux openSUSE

### Issue description

Cyclic Dependencies in shader result in infinite loop

### Steps to reproduce

Create 'main' shader that includes other shader, let's say `inc_me1` and `inc_me2` if 'inc_me1' that includes 'main' shader and 'inc_me2' includes 'inc_me1'. It results in a freeze.

### Minimal reproduction project

[Shader dependency.zip](https://github.com/godotengine/godot/files/11547654/Shader.dependency.zip)
uncomment include, and the editor will freeze and crash
const int line = p_tokenizer->get_line();
	if (state->current_branch == nullptr || state->current_branch->else_defined) {
		set_error(RTR("Unmatched else."), line);
		return;
	}
	if (state->previous_region != nullptr) {
		state->previous_region->to_line = line - 1;
	}
	if (!p_tokenizer->consume_empty_line()) {
		set_error(RTR("Invalid else."), p_tokenizer->get_line());
	}
	bool skip = false;
	for (int i = 0; i < state->current_branch->conditions.size(); i++) {
		if (state->current_branch->conditions[i]) {
			skip = true;
			break;
		}
	}
	state->current_branch->else_defined = true;
	if (state->save_regions) {
		add_region(line + 1, !skip, state->previous_region->parent);
	}
	if (skip) {
		Vector<String> ends;
		ends.push_back("endif");
		next_directive(p_tokenizer, ends);
	}
}
void ShaderPreprocessor::process_endif(Tokenizer *p_tokenizer) {