Work around Darwin bug where write(2)s with nbytes > INT_MAX fail.
That would trigger when we have a very fast stdin but a relatively slow server.