Fixed zpipes client to handle write errors

Fixes #43
Merge pull request #44 from hintjens/master

Fixed zpipes client to handle write errors