Line folds are managed using metadata of AssDialogue elements, and
saved in the project properties. They only affect the appearance of the
subtitle grid, and have no impact on other line operations.
iterator_to requires that the object be in the list, which is sometimes
not the case when processing a commit which removed the active line or a
selected line. To handle this, add a checked version that returns
Events.end() when it is not in the list rather than crashing.