Make writing state files "atomic"...
Make writing state files "atomic"...

…to avoid possible file corruption if the browser is terminated between
the open/write/close at the OS level…

Auditor: @bsclifton

Possibly addresses
https://community.brave.com/t/payments-going-wrong-as-in-not-going-to-th
e-visited-sites/175

pmkary/braver,luixxiul/browser-laptop,timborden/browser-laptop,pmkary/braver,timborden/browser-laptop,diasdavid/browser-laptop,luixxiul/browser-laptop,darkdh/browser-laptop,timborden/browser-laptop,darkdh/browser-laptop,timborden/browser-laptop,diasdavid/browser-laptop,luixxiul/browser-laptop,luixxiul/browser-laptop,darkdh/browser-laptop,diasdavid/browser-laptop,pmkary/braver,darkdh/browser-laptop,pmkary/braver,diasdavid/browser-laptop