An abandoned background wait learns its run is over only when cleanup finishes, after the error handler's own slow reads. In that gap the orphan still writes its file into a box that is being torn down.
Mark work abandoned the moment its deadline fires. Later cleanup leaves the orphan a window.
Check that mark right before each write. An earlier check misses the awaits in between.
Check that mark right before each write. An earlier check misses the awaits in between.