file utils: add atomic file write class

(integrated from master branch change 156e334 by Todd Whiteman <toddw@activestate.com>)