Fix ScalaWordFinder AIOOBE

This is a rebased, polished version of #792

Supersedes #792.

Commented on by @sschaef, [LGTMed](https://github.com/scala-ide/scala-ide/pull/809#issuecomment-56953024) by @skyluc, controversial commit 07c87d7 removed on @dragos' comment.