For future reference, you can always close a Query window by clicking its
X in the list of windows in the left hand column, which shows all the windows currently open. I.e. like closing any other window

If you leave more than one query window open, you can also jump back and forth, from query to query simply by clicking its window in this column.