Fix crash when extending selection
When doing word selection use the previous selection anchor if the new one is out of bounds (user scrolled out of view or similar).
I have a branch refactoring the word selection stuff a bit, but it's a bit more invasive. This is the minimal change I could get to fix it.
Reviewers: hindenburg, pavelkh, ngraham
Reviewed By: hindenburg
Differential Revision: https://phabricator.kde.org/D18862