Make lockmem a per job option

We need to get rid of per job options that fiddle with global
state. It's confusing, and it breaks remote option handling.

Signed-off-by: Jens Axboe <axboe@kernel.dk>

Conflicts:
	backend.c
	fio.h
	init.c
	options.c

Signed-off-by: Jens Axboe <axboe@kernel.dk>
diff --git a/backend.c b/backend.c
index c397eb1..5fc0fc8 100644
--- a/backend.c
+++ b/backend.c
@@ -1205,6 +1205,9 @@
 	}
 #endif
 
+	if (fio_pin_memory(td))
+		goto err;
+
 	/*
 	 * May alter parameters that init_io_u() will use, so we need to
 	 * do this first.
@@ -1330,6 +1333,8 @@
 	td->ts.io_bytes[DDIR_WRITE] = td->io_bytes[DDIR_WRITE];
 	td->ts.io_bytes[DDIR_TRIM] = td->io_bytes[DDIR_TRIM];
 
+	fio_unpin_memory(td);
+
 	fio_mutex_down(writeout_mutex);
 	if (td->bw_log) {
 		if (td->o.bw_log_file) {
@@ -1545,9 +1550,6 @@
 	unsigned long spent;
 	unsigned int i, todo, nr_running, m_rate, t_rate, nr_started;
 
-	if (fio_pin_memory())
-		return;
-
 	if (fio_gtod_offload && fio_start_gtod_thread())
 		return;
 	
@@ -1780,7 +1782,6 @@
 	fio_idle_prof_stop();
 
 	update_io_ticks();
-	fio_unpin_memory();
 }
 
 void wait_for_disk_thread_exit(void)