Exit MoveWay mode on undo (fixes #562)