check connection before close adbc socket.