Fix BadLocationException after switching to visual

When a file with Windows endlines is open and we switch from Visual line
to Visual mode everything appears fine. When switching sides ('o'), an
exception would be thrown because leaving Visual line mode created a
selection which ends in the middle of a \r\n pair.

Using VimUtils.safeAddModelOffset will make sure the cursor is always on
the line.

Fixes #429.