Unfortunately there is no prologue, but you can add a clean up task in your job that depends on your write data.
I suggest you to write a little batch file that you can mpiexec like this :
mpiexec -hosts %CCP_NODES: 4= 1% cmd /c cleanup.cmd
this is to execute on 4 core servers only one cleanup.cmd batch file.
If the job failed or is cancelled, this task may be executed. I suggest you eventually to do a cleanup before starting your job too.
So in your job you ay have 3 tasks :