kill the Task's prior state before _atexit hooks (#46974)
This should help let TEMP_CLEANUP fail less often in our CI logs.
For example, now you can do this:
$ julia -q
julia> open(mktempdir()*"/foobar", "w")
IOStream(<file /tmp/jl_xjRfgj/foobar>)
julia> finalizer(exit, big(1))
1
julia> GC.gc()
julia> GC.gc()
$