Retry EAGAIN/EWOULDBLOCK during syswrite

Possible solution for #213. A simpler approach than using kgio. Solved the issue for me.