Only change state during permissions backup for backed up permissions

There is currently a race condition where the permissions backup can
retreive permissions state, then the notification permission migration
changes the state out from under it, then the permissions backup resets
The notification state back, by accident. To avoid this, only change
permissions that were actually backed up.

Fixes: 228869515
Test: manual

Change-Id: I6cbe259b37f6431499a1037a8159569075a933b5
3 files changed