Slxu kill cleanup

Clean up system resources, especially network resources when a query is killed.
(Both in `Consumer.cleanup` and in this `cleanup` function)