Retry short writes to the TAP device

It's not clear to me if write() can reasonably be expected to return 0
in this (blocking) case, but since the result would be an infinite loop,
we treat it as an error and bail out.