Add job number specific dumping and fix atexit() error

The threads/process jobs should use _exit() so they don't run
the main atexit() function.

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
diff --git a/filehash.c b/filehash.c
index b459220..54cea99 100644
--- a/filehash.c
+++ b/filehash.c
@@ -79,6 +79,23 @@
 	return alias;
 }
 
+void file_hash_exit(void)
+{
+	unsigned int i, has_entries = 0;
+
+	fio_mutex_down(hash_lock);
+	for (i = 0; i < HASH_BUCKETS; i++)
+		has_entries += !list_empty(&file_hash[i]);
+	fio_mutex_up(hash_lock);
+
+	if (has_entries)
+		log_err("fio: file hash not empty on exit\n");
+
+	file_hash = NULL;
+	fio_mutex_remove(hash_lock);
+	hash_lock = NULL;
+}
+
 void file_hash_init(void *ptr)
 {
 	unsigned int i;