Check for valid offset when calculating insertion annotations

In rare cases getNearestContentOffset can return -1. We check 'left'
is not -1, but not 'right'.

Bug: 59972
Change-Id: I15efbd49262ff12f9d56f79304fde10fff10eb59
Merge "Check for valid offset when calculating insertion annotations"