Fix undo when notes are changed and then removed by the overlap checker (#3995).