Loop Iteration Offset Bug

Reset file descriptor offset value to the initial value when file is
closed and io state is cleared. This fixes the bug where previous offset
values persist between loop iterations.

Signed-off-by: Jens Axboe <axboe@fb.com>
diff --git a/libfio.c b/libfio.c
index 9ed802a..b823bd4 100644
--- a/libfio.c
+++ b/libfio.c
@@ -108,8 +108,10 @@
 	reset_io_counters(td);
 
 	close_files(td);
-	for_each_file(td, f, i)
+	for_each_file(td, f, i) {
 		fio_file_clear_done(f);
+		f->file_offset = get_start_offset(td, f);
+	}
 
 	/*
 	 * Set the same seed to get repeatable runs