Made the code more robust related to sendfile.
Made the code more robust related to sendfile.

It's possible that sendfile returns less bytes written than requested.
Previously, we simply return an error in that case. This patch makes it
more robust by retrying sendfile if less bytes were written than
requested.

Review: https://reviews.apache.org/r/69944/

gsantovena/mesos,chhsia0/mesos,gsantovena/mesos,dforsyth/mesos,Gilbert88/mesos,chhsia0/mesos,chhsia0/mesos,chhsia0/mesos,kaysoky/mesos,chhsia0/mesos,Gilbert88/mesos,jpeach/mesos,gsantovena/mesos,reneploetz/mesos,jpeach/mesos,jpeach/mesos,reneploetz/mesos,kaysoky/mesos,dforsyth/mesos,gsantovena/mesos,dforsyth/mesos,abudnik/mesos,jpeach/mesos,kaysoky/mesos,Gilbert88/mesos,abudnik/mesos,abudnik/mesos,Gilbert88/mesos,kaysoky/mesos,gsantovena/mesos,kaysoky/mesos,dforsyth/mesos,abudnik/mesos,reneploetz/mesos,Gilbert88/mesos,abudnik/mesos,dforsyth/mesos,chhsia0/mesos,dforsyth/mesos,abudnik/mesos,abudnik/mesos,kaysoky/mesos,gsantovena/mesos,jpeach/mesos,jpeach/mesos,reneploetz/mesos,gsantovena/mesos,chhsia0/mesos,dforsyth/mesos,jpeach/mesos,Gilbert88/mesos,kaysoky/mesos,Gilbert88/mesos,reneploetz/mesos,reneploetz/mesos,reneploetz/mesos