More comprehensive cleanup on connection closure