Cleanup phantom .tmp files on error