fix renaming temp files on partial run

Change-Id: I9c30dcde210399b3f2954afb22ad478421f9331e