(#8119) Write reports to a temporary file and move them into place
When writing reports, there is a window in between opening and writing to the
report file when the report file exists as an empty file. This makes writing
report processors a little annoying as they have to deal with this case. This
writes the report into a temporary file then renames it to the report file.
Signed-off-by: Patrick Carlisle <patrick@puppetlabs.com>