### 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
if (!p_continue) {
		state->condition_depth++;
		state->current_branch = &state->branches.push_back(Branch(p_success, state->current_branch))->get();
	} else {
		state->current_branch->conditions.push_back(p_success);
	}
	if (!p_success) {
		Vector<String> ends;
		ends.push_back("elif");
		ends.push_back("else");
		ends.push_back("endif");
		next_directive(p_tokenizer, ends);
	}
}
void ShaderPreprocessor::expand_output_macros(int p_start, int p_line_number) {
	String line = vector_to_string(output, p_start, output.size());
	Error error = expand_macros(line, p_line_number - 1, line); 
	if (error != OK) {
		return;
	}
	output.resize(p_start);
	add_to_output(line);
}
Error ShaderPreprocessor::expand_condition(const String &p_string, int p_line, String &r_expanded) {