Properly check for EWOULDBLOCK as well