Slxu kill cleanup

Clean up system resources, especially network resources when a query is killed.
Actually there's no concurrency here. I overprotected the code block. I'll simplify it to make it more clear.