fix(system): write all files atomically
Merge pull request #140 from jonboulle/atomic

fix(system): write all files atomically