Don't show mouse dwell tooltip in text editor if the cursor position is invalid

Fixes #160