Slxu kill cleanup

Clean up system resources, especially network resources when a query is killed.
What are the concurrency properties here? Can anyone else have a pointer to `input` when this function is called?