Fix bug in findWordAt

Which could result in a selection at a negative character offset
when double-clicking.

Issue #1638