UseSWIG: ensure directory for depfile exists

When `Visual Studio` and `Xcode` generators are used, directory for depfile
is not implicitely created by CMake when OUTFILE_DIR option is used.

Fixes: #22932
35 jobs for !6750 with UseSWIG-create-workingdir in 19 minutes and 34 seconds (queued for 1 second)
latest merge request