There is no change in behavior. This just helps prepare for the
transition from boost::filesystem to std::filesystem by avoiding
copy_file calls that will be unsafe after the transition to
std::filesystem to due lack of a boost::filesystem::path::imbue
equivalent and inability to set a predictable locale.
This is a partial backport of core#24026
https://github.com/bitcoin/bitcoin/pull/24026/commits/213172c7348091794b173c2edf5f7f3bbe010912
Note: the rest of the PR is not applicable due to missing wallet backports