patch 9.0.0626: too many delete() calls in tests

Problem:    Too many delete() calls in tests.
Solution:   Use deferred delete where possible.
diff --git a/src/testdir/test_mapping.vim b/src/testdir/test_mapping.vim
index bc5b487..58a5d95 100644
--- a/src/testdir/test_mapping.vim
+++ b/src/testdir/test_mapping.vim
@@ -420,7 +420,7 @@
   nmap <expr> ! Func()
   set updatetime=50
   [CODE]
-  call writefile(lines, 'Xtest.vim')
+  call writefile(lines, 'Xtest.vim', 'D')
 
   let buf = term_start(GetVimCommandCleanTerm() .. ' -S Xtest.vim', {'term_rows': 8})
   let job = term_getjob(buf)
@@ -439,7 +439,6 @@
     call assert_equal('', job_info(job).termsig)
   endif
 
-  call delete('Xtest.vim')
   exe buf .. 'bwipe!'
 endfunc
 
@@ -565,14 +564,13 @@
       endfunc
       set stl=%{Status()}
   END
-  call writefile(lines, 'XtestExprMap')
+  call writefile(lines, 'XtestExprMap', 'D')
   let buf = RunVimInTerminal('-S XtestExprMap', #{rows: 10})
   call term_sendkeys(buf, "\<C-B>")
   call VerifyScreenDump(buf, 'Test_map_expr_1', {})
 
   " clean up
   call StopVimInTerminal(buf)
-  call delete('XtestExprMap')
 endfunc
 
 func Test_map_listing()
@@ -581,14 +579,13 @@
   let lines =<< trim END
       nmap a b
   END
-  call writefile(lines, 'XtestMapList')
+  call writefile(lines, 'XtestMapList', 'D')
   let buf = RunVimInTerminal('-S XtestMapList', #{rows: 6})
   call term_sendkeys(buf, ":                      nmap a\<CR>")
   call VerifyScreenDump(buf, 'Test_map_list_1', {})
 
   " clean up
   call StopVimInTerminal(buf)
-  call delete('XtestMapList')
 endfunc
 
 func Test_expr_map_error()
@@ -605,7 +602,7 @@
 
       call test_override('ui_delay', 10)
   END
-  call writefile(lines, 'XtestExprMap')
+  call writefile(lines, 'XtestExprMap', 'D')
   let buf = RunVimInTerminal('-S XtestExprMap', #{rows: 10})
   call term_sendkeys(buf, "\<F2>")
   call TermWait(buf)
@@ -619,7 +616,6 @@
 
   " clean up
   call StopVimInTerminal(buf)
-  call delete('XtestExprMap')
 endfunc
 
 " Test for mapping errors
@@ -1081,11 +1077,10 @@
       let g:x = 32
     endfunc
   END
-  call writefile(lines, 'Xscript')
+  call writefile(lines, 'Xscript', 'D')
   source Xscript
   call feedkeys("\<F2>", 'xt')
   call assert_equal(32, g:x)
-  call delete('Xscript')
 
   unmap <F3>
   unmap! <F3>
@@ -1530,7 +1525,7 @@
 endfunc
 
 func Test_map_script_cmd_redo()
-  call mkdir('Xmapcmd')
+  call mkdir('Xmapcmd', 'R')
   let lines =<< trim END
       vim9script
       import autoload './script.vim'
@@ -1554,7 +1549,6 @@
 
   ounmap <F3>
   nunmap j
-  call delete('Xmapcmd', 'rf')
   bwipe!
 endfunc
 
@@ -1724,7 +1718,7 @@
     inoremap ab TEST
     inoremap a <Nop>
   END
-  call writefile(lines, 'Xtest_map_after_timed_out_nop')
+  call writefile(lines, 'Xtest_map_after_timed_out_nop', 'D')
   let buf = RunVimInTerminal('-S Xtest_map_after_timed_out_nop', #{rows: 6})
 
   " Enter Insert mode
@@ -1741,7 +1735,6 @@
 
   " clean up
   call StopVimInTerminal(buf)
-  call delete('Xtest_map_after_timed_out_nop')
 endfunc
 
 func Test_using_past_typeahead()