Adapt query-replace and lazy highlighting to text conversion
* lisp/isearch.el (isearch-lazy-highlight-new-loop): Rather call
redisplay to guarantee a valid window-start than sit-for, to
account for cases where this function is called from an
after-change-function bound to a special input event quickly
followed by another event that does not modify the buffer.
* lisp/progmodes/prog-mode.el (treesit-node-at): Declare
function before references.
* lisp/replace.el (perform-replace): When querying, suppress
text conversion around the input loop.
(cherry picked from commit
b236a2529dd90c9f506243b594e2a0d33afb0946)