[DF-1294] Fix tilemask editor undo/redo