Make sure to restore a valid selectedRange.

This discards any selection, but since the document is changing
a selection will not be usefull after the uncrustify anyway.