Add a lock when writing temporary files in BootReceiver

This is needed because there is potentially a race condition between when NativeTombstoneManager tries to delete leftover .tmp files and when those files are added to dropbox.

Test: atest ErrorsTest
Bug: 284900963
Change-Id: I07936c51646915cb8760f45c4bb920f5fb335025
2 files changed