Fix another case of freed markers in the undo-list (Bug#30931)