### Godot version

4.1.rc.custom_build. c83f912bc

### System information

Ubuntu 22.04 CI

### Issue description

When executing
```
extends Node
func _process(delta):

	var temp_variable35241 = RichTextLabel.new()
	add_child(temp_variable35241)
	temp_variable35241.set_fit_content(true)
	temp_variable35241.parse_bbcode("3188932498")
	temp_variable35241.queue_free()
```
this code freeze project in CI for at least 60 seconds

### Steps to reproduce

Above

### Minimal reproduction project

N/A
_validate_line_caches();
	int to_line = main->first_invalid_line.load();
	if (0 <= p_paragraph && p_paragraph < to_line) {
		return main->lines[p_paragraph].offset.y;
	}
	return 0;
}
int RichTextLabel::get_line_count() const {
	const_cast<RichTextLabel *>(this)->_validate_line_caches();
	int line_count = 0;
	int to_line = main->first_invalid_line.load();
	for (int i = 0; i < to_line; i++) {
		MutexLock lock(main->lines[i].text_buf->get_mutex());
		line_count += main->lines[i].text_buf->get_line_count();
	}
	return line_count;
}
int RichTextLabel::get_visible_line_count() const {