Fix path completion when UTF8 char is occurring before match characters.

Small fix to #8838 so completion works again on: `"β $dir_space\\space"`, @tkelman, @ivarne
It seems like searching strings in reverse is common enough and so error-prone that we should export a `revind(s,i) = nextind(s,endof(s)) - i` function from Base, and document it along with `reverse`.