Slxu kill cleanup

Clean up system resources, especially network resources when a query is killed.
LGTM. I'll split it into two methods.