Only set and run internal search for linking selected text if the panel is open. Make sure the focus is in the URL field whenever opening the linking modal to preserve previous behavior. props greuben. fixes #16276.

Built from https://develop.svn.wordpress.org/trunk@25031


git-svn-id: https://core.svn.wordpress.org/trunk@25018 1a063a9b-81f0-0310-95a4-ce76da25c4cd