DO NOT MERGE: Backport N backup/restore stability work to M
am: d6f3a11107

Change-Id: Ibd6e1be57f129d9ea89c8a44332da830944cf2b1