Fix #9209

This fixes #9209, which is a 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.

cc @tkelman @Luthaf @dhoegh