Unify and fixup error handling

First step in getting ->queue() and ->getevents() handled in
a more sane fashion.

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
diff --git a/engines/sync.c b/engines/sync.c
index 6a5b7d3..5cf7366 100644
--- a/engines/sync.c
+++ b/engines/sync.c
@@ -41,7 +41,7 @@
 		ret = fsync(f->fd);
 
 	if (ret != (int) io_u->xfer_buflen) {
-		if (ret > 0) {
+		if (ret >= 0) {
 			io_u->resid = io_u->xfer_buflen - ret;
 			io_u->error = 0;
 			return FIO_Q_COMPLETED;