This fixes the memory leak in the case the connection has been successfully closed by the peer. Part-of: <!3609>