socket: retry on EAGAIN