chardev: fix handling of EAGAIN for TCP chardev