fd: Let write_all() return an error on short writes.
Short writes are often ignored because most callers of write_all()
do not check the return value. Rather than fixing all callers, this
patch teaches write_all() to detect short writes and return the new
E_SHORT_WRITE error code in this case.
Currently write_all() is a wrapper for write(), similar to
write_nonblock() but lacking the safety checks of the latter. To get
these safety checks, write_all() is changed to call write_nonblock().