Obtain a new window for a client before releasing the current one
Obtain a new window for a client before releasing the current one

Creating a window potentially runs hooks, which themselves could
trigger shell evaluation, which could handle urgent input events
such as a resize, while waiting for the shell to finish. When that
happens, the client had a temporarily null window as it had already
released its own window.

Fixes #2225

Somasis/kakoune,danr/kakoune,jkonecny12/kakoune,Somasis/kakoune,mawww/kakoune,occivink/kakoune,jkonecny12/kakoune,danr/kakoune,lenormf/kakoune,danr/kakoune,Somasis/kakoune,alexherbo2/kakoune,alexherbo2/kakoune,jjthrash/kakoune,casimir/kakoune,lenormf/kakoune,mawww/kakoune,occivink/kakoune,casimir/kakoune,casimir/kakoune,danr/kakoune,jkonecny12/kakoune,alexherbo2/kakoune,jkonecny12/kakoune,alexherbo2/kakoune,lenormf/kakoune,lenormf/kakoune,jjthrash/kakoune,occivink/kakoune,jjthrash/kakoune,mawww/kakoune,mawww/kakoune,casimir/kakoune,Somasis/kakoune,occivink/kakoune,jjthrash/kakoune