Use AtomicFile

This should guarantee the integrity of the file content and
prevent the issue like b/170697897#comment2.

Bug: 170697897
Test: atest StagedRollbackTest
Change-Id: I4c2acb80fd9c806e31aa04d6defb480dafcf2c50
1 file changed