Not a solution, but if I disconnect the query before closing the tab I don’t get the popup. I added a disconnect button to the toolbar to make it less intrusive.
And I’ve since assigned the keys so Ctrl-Shift-F4 to disconnect and Ctrl-F4 to close so that makes multiple tabs less annoying.