### Godot version

4.1 Stable

### System information

MacBook Ventura 13.4

### Issue description

Undo/Redo manager `history_changed` events stop being emitted when clicking on the same editor inspector property. This also stops creating Undo/Redo events, so "undo" actions stop working.

### Steps to reproduce

The steps to reproduce is kind of finnicky, but I was able to reproduce it with relative easy using the "position" propert:

- Click "Y" position and change it to any value; press Enter.
- Click the "Y" position again and change it to any value; press Enter.
- Click the "Y" position again (again), and change it to any value; press Enter.

On the third time changing the value, "history_changed" events stop being emitted. Checking the "History" tab, you'll see only the two events are logged (other changes in the position are not).



### Minimal reproduction project

This can be reproduced in any project, but I'm attaching a project with an addon that logs a "history_changed" event on the console so you know when it stops being emitted.
[HistoryIssue.zip](https://github.com/godotengine/godot/files/12053128/HistoryIssue.zip)

if (pending_action.history_id == INVALID_HISTORY) {
		return; 
	}
	is_committing = true;
	History &history = get_or_create_history(pending_action.history_id);
	history.undo_redo->commit_action(p_execute);
	history.redo_stack.clear();
	if (history.undo_redo->get_action_level() > 0) {
		
		is_committing = false;
		return;
	}
	if (!history.undo_stack.is_empty()) {
		
		switch (pending_action.merge_mode) {
			case UndoRedo::MERGE_DISABLE:
				break; 
			case UndoRedo::MERGE_ENDS: {
				if (history.undo_stack.size() < 2) {
					break;
				}
				const Action &prev_action = history.undo_stack.back()->get();
				const Action &pre_prev_action = history.undo_stack.back()->prev()->get();
				if (pending_action.merge_mode == prev_action.merge_mode && pending_action.merge_mode == pre_prev_action.merge_mode &&
						pending_action.action_name == prev_action.action_name && pending_action.action_name == pre_prev_action.action_name) {
					pending_action = Action();
					is_committing = false;
					return;
				}