### Godot version

4.1.1

### System information

linux

### Issue description

- When favoriting a path in a `FileDialog`, clicking on it travels to `path/to/dir/`.
- When going up a level from there, it doesn't go to `path/to` but to `path/to/dir` (without the `/`).

[simplescreenrecorder-2023-08-18_09.38.37.webm](https://github.com/godotengine/godot/assets/71937306/00c20ad3-292f-4961-84ed-dbc64906df52)

The problem is either (or both) that:
 - loaded path has a trailing `/`
 - parent dir of `stuff/` is considered to be `stuff`

### Steps to reproduce

favorite a directory and use the feature to navigate to it

### Minimal reproduction project

any (i.e. the project manager's "new project" dialog has one)
ConfirmationDialog::_post_popup();
	
	String current = dir_access->get_current_dir();
	while (!dir_access->dir_exists(current)) {
		current = current.get_base_dir();
	}
	set_current_dir(current);
	if (mode == FILE_MODE_SAVE_FILE) {
		file->grab_focus();
	} else {
		item_list->grab_focus();
	}
	if (mode == FILE_MODE_OPEN_DIR) {
		file_box->set_visible(false);
	} else {
		file_box->set_visible(true);
	}
	if (!get_current_file().is_empty()) {
		_request_single_thumbnail(get_current_dir().path_join(get_current_file()));
	}
	local_history.clear();
	local_history_pos = -1;
	_push_history();
	set_process_shortcut_input(true);
}
void EditorFileDialog::_thumbnail_result(const String &p_path, const Ref<Texture2D> &p_preview, const Ref<Texture2D> &p_small_preview, const Variant &p_udata) {