sg: use a cp them rm to avoid issues with FS
Created by: jhchabran
When downloading mandatory binaries such as caddy, os.Rename can fail because the temp folder is living in another partition. This change adds a safeRename function that handles that edge case.
Test plan
Tested locally.