Fix #9209

Regression from #9137. The problem was that the Latex completion code
might access an invalid index in the unicode string, if the previous
character from a `\\` was a multibyte character.

ref: #9210
(cherry picked from commit 9c1414737a7269442f44f5b3bcd99df324a27b6d)