TCC-2584 fix error during connection closure.