Refactored a bit to run two promises simultaneously.
We're using the same key as for the main database, because there is a bug on Safari which requires generating keys on the main thread (ENG-3872), and I think using the same key here should be fine, as restored database is temporary and we persist it only to restore in case of app being killed in the middle of restore.
Depends on D14804