Check for open files on io operations

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
diff --git a/ioengines.c b/ioengines.c
index 185314f..b18bc9a 100644
--- a/ioengines.c
+++ b/ioengines.c
@@ -186,6 +186,8 @@
 	assert((io_u->flags & IO_U_F_FLIGHT) == 0);
 	io_u->flags |= IO_U_F_FLIGHT;
 
+	assert(io_u->file->flags & FIO_FILE_OPEN);
+
 	io_u->error = 0;
 	io_u->resid = 0;