On Android, save the Directory when the app is backgrounded.
Because we don't know when the app will be killed, the current
time before Directory saves can result in lost data. This
change uses the app getting backgrounded as a signal that we
might be killed soon and triggers a Directory::SaveChanges().
BUG=
395233
Committed:
https://crrev.com/d4470ca3ec0642a68abe141b6bd69529d5814315
Cr-Commit-Position: refs/heads/master@{#297547}