Add test for running a query on a closed connection