Assign io_u->error directly in do_io_u_sync()

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
diff --git a/ioengines.c b/ioengines.c
index 155649b..366382e 100644
--- a/ioengines.c
+++ b/ioengines.c
@@ -465,5 +465,8 @@
 		io_u->error = EINVAL;
 	}
 
+	if (ret < 0)
+		io_u->error = errno;
+
 	return ret;
 }