(#12463) add secure replace_file to Puppet::Util
There is some complex logic around replacing an existing file safely, and it
used to be scattered all over the tree - making the whole system much harder
to use nicely and pleasantly.
It is much better that we provide a central, and easy to use, method for
achieving that specific and common goal in a consistent, secure, and easy to
audit fashion.
Based on code submitted by me on 2010-04-08.
Signed-off-by: Daniel Pittman <daniel@puppetlabs.com>