Only use first line of primary selection when populating FindInFiles bar

For #8211
I'm not sure there's that much of a wider use for it (do you see other copies of this pattern elsewhere in core yet?). But also, putting something in FindUitls means you can encapsulate the getSelection() call too, and there's only one place to update when we later change to support multi-line selections.