copy and delete srvcfg-mgr.json file instead of rename

Not sure when this issue was introduced but it was noticed recently that
the following was popping up in the journals on one of our new systems:

```
Oct 13 14:12:31 balcones phosphor-srvcfg-manager[1134]: Moving /etc/srvcfg-mgr.json to new location, /var/lib/service-config-manager/srvcfg-mgr.json
Oct 13 14:12:31 balcones srvcfg-manager[1134]: terminate called after throwing an instance of 'std::filesystem::__cxx11::filesystem_error'
Oct 13 14:12:31 balcones srvcfg-manager[1134]:   what():  filesystem error: cannot rename: Invalid cross-device link [/etc/srvcfg-mgr.json] [/var/lib/service-config-manager/srvcfg-mgr.json]
Oct 13 14:12:31 balcones systemd-coredump[1151]: Process 1134 (phosphor-srvcfg) of user 0 terminated abnormally with signal 6/ABRT, processing...
Oct 13 14:12:31 balcones systemd-coredump[1152]: Process 1134 (phosphor-srvcfg) of user 0 dumped core.
```

I didn't see this in my testing back when this change was introduced but
it may have something to do with what's present in the overlay
filesystem on /etc. Either way, to avoid this issue, do a copy and then
delete of the file.

Tested:
- Confirmed the file is correctly moved to expected location in /var and
  /etc file is deleted

Change-Id: I75a6f17e685e78a5dcd390220d5b1e7d95bd8322
Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
diff --git a/src/main.cpp b/src/main.cpp
index d82f7b9..4533512 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -187,7 +187,10 @@
         lg2::info("Moving {OLDFILEPATH} to new location, {FILEPATH}",
                   "OLDFILEPATH", srvCfgMgrFileOld, "FILEPATH",
                   srvCfgMgrFilePath);
-        std::filesystem::rename(srvCfgMgrFileOld, srvCfgMgrFilePath);
+        // Note that the rename() function can run into issues when /etc
+        // is an overlay on /var so use copy/remove instead
+        std::filesystem::copy(srvCfgMgrFileOld, srvCfgMgrFilePath);
+        std::filesystem::remove(srvCfgMgrFileOld);
     }
 
     bool jsonExist = std::filesystem::exists(srvCfgMgrFilePath);