[Fixes bug #1082663] Fix a few bugs with the text tool and selections.

The text tool now stores the original selection from when the editing of
that piece of text started. This ensures that the text doesn't suddenly
disappear or reappear if the selection changes before the text gets
finalized.