chardev: fix race with client connections in tcp_chr_wait_connected