connection: fix socket 'close' handling
1.18.1