Fix bug in double-click selection
A bug introduced in 0752cf3d prevents copying selection to clipboard if a key is pressed a short time after a double click. This is avoided by:
- Do not exit selection mode in the time interval between a double click and a (potential) third click.
- Save the selection text on a double click, and copy the saved text, rather than the current selection if no third click at the end of the triple click interval.