With several cursors and nothing selected, the per-selection text joined
into a string of newlines, which passed the `!text.is_empty()` check and
replaced the primary selection on every keystroke and cursor move.
Only write to the primary selection when at least one selection is
non-empty.
Closes#64446