Fix for file_service_type=random

We need to retrieve a new random offset if the file is closed,
obviously.

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
diff --git a/io_u.c b/io_u.c
index 978771e..6df4b5e 100644
--- a/io_u.c
+++ b/io_u.c
@@ -329,11 +329,12 @@
  */
 static struct fio_file *get_next_file_rand(struct thread_data *td)
 {
-	long r = os_random_long(&td->next_file_state);
 	unsigned int fileno;
 	struct fio_file *f;
 
 	do {
+		long r = os_random_long(&td->next_file_state);
+
 		fileno = (unsigned int) ((double) (td->nr_files - 1) * r / (RAND_MAX + 1.0));
 		f = &td->files[fileno];
 		if (f->fd != -1)