Check write(...) errno