ve.dm.TransactionProcessor: Fix edge case handling, avoid ES6 methods
End the correct annotation when encountering a bias=='stop' operation.
Previously, we always ended the first annotation (the index variable
actually contained the value, not the index, which was casted to 0).
It did not matter in practice because it seems that the editor always
generates transactions with only one annotation changed in each, but
that may change (there is a relevant TODO in AnnotationAction#clearAll).
Updated a test to exercise this code. It would fail without this patch.
Also, do not use the ES6 Array#find method. It is not available in all
browsers we support, e.g. IE 11.