Enfore that lockfile= must precede filename=

The way fio parses options, we need to have the file locking
defined before we start adding files. Normally we can handle
this with option priorities, but that doesn't work across
job section boundaries. So catch this case and error out,
otherwise fio will segfault when it attempts to unlock files
at the end of a job.

Signed-off-by: Jens Axboe <axboe@fb.com>
diff --git a/filesetup.c b/filesetup.c
index bae6092..544ecb1 100644
--- a/filesetup.c
+++ b/filesetup.c
@@ -1266,7 +1266,7 @@
 
 void unlock_file_all(struct thread_data *td, struct fio_file *f)
 {
-	if (td->o.file_lock_mode == FILE_LOCK_NONE)
+	if (td->o.file_lock_mode == FILE_LOCK_NONE || !td->file_locks)
 		return;
 	if (td->file_locks[f->fileno] != FILE_LOCK_NONE)
 		unlock_file(td, f);