Check return value of write, even for a pipe, thanks gcc