Handling EAGAIN for read, which is necessary