patch 8.0.1260: using global variables for WaitFor()

Problem:    Using global variables for WaitFor().
Solution:   Use a lambda function instead.  Don't check a condition if
            WaitFor() already checked it.
diff --git a/src/testdir/test_job_fails.vim b/src/testdir/test_job_fails.vim
index ddab6a3..22637c0 100644
--- a/src/testdir/test_job_fails.vim
+++ b/src/testdir/test_job_fails.vim
@@ -6,14 +6,11 @@
 
 func Test_job_start_fails()
   if has('job')
-    let g:job = job_start('axdfxsdf')
+    let job = job_start('axdfxsdf')
     if has('unix')
-      call WaitFor('job_status(g:job) == "dead"')
-      call assert_equal('dead', job_status(g:job))
+      call WaitFor({-> job_status(job) == "dead"})
     else
-      call WaitFor('job_status(g:job) == "fail"')
-      call assert_equal('fail', job_status(g:job))
+      call WaitFor({-> job_status(job) == "fail"})
     endif
-    unlet g:job
   endif
 endfunc