LPS-34802 we need to do this because the second rename fails in windows because the file already existed. UNIX handle this properly.