tcp-client: handle connection errors