patch 8.2.0304: terminal test if failing on some systems

Problem:    Terminal test if failing on some systems.
Solution:   Wait for the job to finish. (James McCoy)
diff --git a/src/testdir/test_terminal.vim b/src/testdir/test_terminal.vim
index 64bc7db..b86614d 100644
--- a/src/testdir/test_terminal.vim
+++ b/src/testdir/test_terminal.vim
@@ -781,7 +781,8 @@
   call writefile(['x'], 'Xdir with spaces/quoted"file')
   term ls Xdir\ with\ spaces/quoted\"file
   call WaitForAssert({-> assert_match('quoted"file', term_getline('', 1))})
-  call term_wait('')
+  " make sure the job has finished
+  call WaitForAssert({-> assert_match('finish', term_getstatus(bufnr()))})
 
   call delete('Xdir with spaces', 'rf')
   bwipe