Fix getAnnotationIndexesFromOffset for last offset in doc

If the element is undefined, it would stand to reason that there are no annotations there.

Just sayin'.

Change-Id: I2b66e7adc2b3af19df1a3f490ab479627807636e