Fixed protobuf::read/write calls to be POSIX compliant (handle 0,
EINTR, and partial reads/writes).

From: Ben Mahler <benjamin.mahler@gmail.com>
Review: https://reviews.apache.org/r/8695

git-svn-id: https://svn.apache.org/repos/asf/incubator/mesos/trunk@1440847 13f79535-47bb-0310-9956-ffa450edef68