Check for EWOULDBLOCK as well as EAGAIN on write.

On some systems, notably HP PA-RISC systems running Linux or HP-UX,
EWOULDBLOCK and EAGAIN are not the same value.  POSIX (and these OSes) allow
EWOULDBLOCK to occur on write(2) (and send(2), etc.), so check explicitly
for this case as well as EAGAIN.  On most systems, where they are the same,
the compiler will simply optimize this check out and it will have no effect.