Introduce ScratchDirManager for deleting old scratch dirs