patch 9.0.0440: crash when using mkdir() with "R" flag in compiled function

Problem:    Crash when using mkdir() with "R" flag in compiled function.
Solution:   Reserve a variable for deferred function calls.  Handle more than
            one argument.
diff --git a/src/testdir/test_vim9_func.vim b/src/testdir/test_vim9_func.vim
index 70a71ea..4d6e226 100644
--- a/src/testdir/test_vim9_func.vim
+++ b/src/testdir/test_vim9_func.vim
@@ -29,7 +29,7 @@
     enddef
     defcompile
   END
-  writefile(lines, 'XTest_compile_error')
+  writefile(lines, 'XTest_compile_error', 'D')
   var buf = g:RunVimInTerminal('-S XTest_compile_error',
               {rows: 10, wait_for_ruler: 0})
   g:WaitForAssert(() => assert_match('Error detected while compiling command line.*Fails.*Variable not found: nothing',
@@ -37,12 +37,11 @@
 
   # clean up
   g:StopVimInTerminal(buf)
-  delete('XTest_compile_error')
 enddef
 
 def TestCompilingErrorInTry()
   var dir = 'Xcompdir/autoload'
-  mkdir(dir, 'p')
+  mkdir(dir, 'pR')
 
   var lines =<< trim END
       vim9script
@@ -62,7 +61,7 @@
       endtry
   END
   lines[1] = 'set rtp=' .. getcwd() .. '/Xcompdir'
-  writefile(lines, 'XTest_compile_error')
+  writefile(lines, 'XTest_compile_error', 'D')
 
   var buf = g:RunVimInTerminal('-S XTest_compile_error', {rows: 10, wait_for_ruler: 0})
   g:WaitForAssert(() => assert_match('Error detected while compiling command line.*function script#OnlyCompiled.*Invalid command: invalid',
@@ -70,8 +69,6 @@
 
   # clean up
   g:StopVimInTerminal(buf)
-  delete('XTest_compile_error')
-  delete('Xcompdir', 'rf')
 enddef
 
 def Test_comment_error()
@@ -171,7 +168,7 @@
 
 def Test_autoload_name_mismatch()
   var dir = 'Xnamedir/autoload'
-  mkdir(dir, 'p')
+  mkdir(dir, 'pR')
 
   var lines =<< trim END
       vim9script
@@ -190,12 +187,11 @@
   v9.CheckScriptFailure(lines, 'E117:', 1)
 
   &rtp = save_rtp
-  delete('Xnamedir', 'rf')
 enddef
 
 def Test_autoload_names()
   var dir = 'Xandir/autoload'
-  mkdir(dir, 'p')
+  mkdir(dir, 'pR')
 
   var lines =<< trim END
       func foobar#function()
@@ -218,12 +214,11 @@
   v9.CheckDefAndScriptSuccess(lines)
 
   &rtp = save_rtp
-  delete('Xandir', 'rf')
 enddef
 
 def Test_autoload_error_in_script()
   var dir = 'Xaedir/autoload'
-  mkdir(dir, 'p')
+  mkdir(dir, 'pR')
 
   var lines =<< trim END
       func scripterror#function()
@@ -264,7 +259,6 @@
   assert_equal('yes', g:called_function)
 
   &rtp = save_rtp
-  delete('Xaedir', 'rf')
 enddef
 
 def s:CallRecursive(n: number): number
@@ -1298,7 +1292,7 @@
     enddef
     defcompile
   END
-  writefile(lines, 'Xscript')
+  writefile(lines, 'Xscript', 'D')
   didCatch = false
   try
     source Xscript
@@ -1308,8 +1302,6 @@
     didCatch = true
   endtry
   assert_true(didCatch)
-
-  delete('Xscript')
 enddef
 
 def Test_call_funcref_wrong_args()
@@ -2306,9 +2298,8 @@
         'morelines',
         name)
   END
-  writefile(lines, 'Xcall.vim')
+  writefile(lines, 'Xcall.vim', 'D')
   source Xcall.vim
-  delete('Xcall.vim')
 enddef
 
 def Test_vim9script_call_fail_decl()
@@ -2343,9 +2334,8 @@
     enddef
     defcompile
   END
-  writefile(lines, 'Xcall_const.vim')
+  writefile(lines, 'Xcall_const.vim', 'D')
   assert_fails('source Xcall_const.vim', 'E46:', '', 1, 'MyFunc')
-  delete('Xcall_const.vim')
 
   lines =<< trim END
       const g:Aconst = 77
@@ -2385,11 +2375,9 @@
     delfunc g:GoneSoon
     CallGoneSoon()
   END
-  writefile(lines, 'XToDelFunc')
+  writefile(lines, 'XToDelFunc', 'D')
   assert_fails('so XToDelFunc', 'E933:', '', 1, 'CallGoneSoon')
   assert_fails('so XToDelFunc', 'E933:', '', 1, 'CallGoneSoon')
-
-  delete('XToDelFunc')
 enddef
 
 func Test_free_dict_while_in_funcstack()
@@ -2454,10 +2442,8 @@
     endfunc
     Func('text')
   END
-  writefile(lines, 'XVim9Func')
+  writefile(lines, 'XVim9Func', 'D')
   so XVim9Func
-
-  delete('XVim9Func')
 enddef
 
 let s:funcResult = 0
@@ -2700,7 +2686,7 @@
     enddef
     defcompile
   END
-  writefile(lines, 'Xdef')
+  writefile(lines, 'Xdef', 'D')
   try
     source Xdef
     assert_report('should have failed')
@@ -2749,8 +2735,6 @@
     v:throwpoint->assert_match('_Func, line 3$')
   endtry
   delfunc! g:Func
-
-  delete('Xdef')
 enddef
 
 def Test_deleted_function()
@@ -3421,14 +3405,12 @@
 enddef
 
 def Test_closure_in_map()
-  mkdir('XclosureDir/tdir', 'p')
+  mkdir('XclosureDir/tdir', 'pR')
   writefile(['111'], 'XclosureDir/file1')
   writefile(['222'], 'XclosureDir/file2')
   writefile(['333'], 'XclosureDir/tdir/file3')
 
   TreeWalk('XclosureDir')->assert_equal(['file1', 'file2', {tdir: ['file3']}])
-
-  delete('XclosureDir', 'rf')
 enddef
 
 def Test_invalid_function_name()
@@ -3532,12 +3514,11 @@
       var it = Iter(l)
       echo it.__next__()
   END
-  call writefile(lines, 'XpartialCall')
+  call writefile(lines, 'XpartialCall', 'D')
   try
     source XpartialCall
   catch /E1248:/
   endtry
-  call delete('XpartialCall')
 endfunc
 
 def Test_cmd_modifier()
@@ -3631,9 +3612,9 @@
       nno <F3> <cmd>call <sid>Func()<cr>
       feedkeys("\<F3>\e", 'xt')
   END
-  writefile(lines, 'XemsgReset')
+  writefile(lines, 'XemsgReset', 'D')
   assert_fails('so XemsgReset', ['E684:', 'E684:'], lines, 2)
-  delete('XemsgReset')
+
   nunmap <F3>
   au! BufWinLeave
 enddef
@@ -3698,7 +3679,7 @@
   END
   # can't use CheckScriptFailure, it ignores the :silent!
   var fname = 'Xdefsilent'
-  writefile(lines, fname)
+  writefile(lines, fname, 'D')
   var caught = 'no'
   try
     exe 'source ' .. fname
@@ -3707,7 +3688,6 @@
     assert_match('Func, line 4', v:throwpoint)
   endtry
   assert_equal('yes', caught)
-  delete(fname)
 enddef
 
 def Test_cmdmod_silent_nested()
@@ -3809,7 +3789,7 @@
       feedkeys('g@l', 'n')
       feedkeys('llll')
   END
-  call writefile(lines, 'XTest_opfunc_error')
+  call writefile(lines, 'XTest_opfunc_error', 'D')
 
   var buf = g:RunVimInTerminal('-S XTest_opfunc_error', {rows: 6, wait_for_ruler: 0})
   g:WaitForAssert(() => assert_match('Press ENTER', term_getline(buf, 6)))
@@ -3817,7 +3797,6 @@
 
   # clean up
   g:StopVimInTerminal(buf)
-  delete('XTest_opfunc_error')
 enddef
 
 " this was crashing on exit
@@ -3890,14 +3869,13 @@
       function s:close_cb(...)
       endfunction
   END
-  lines->writefile('Xlegacy.vim')
+  lines->writefile('Xlegacy.vim', 'D')
   source Xlegacy.vim
   g:LegacyJob()
   g:LegacyJob()
   g:LegacyJob()
 
   delfunc g:LegacyJob
-  delete('Xlegacy.vim')
 enddef
 
 def Test_check_func_arg_types()