Earlier we were storing the custom API origin setting in local storage.
Local storage is not accessible from web workers, which is a problem in
general (and in particular, this caused face indexing to fail since we
were not able to put the embeddings to remote since that code runs in a
web worker).
Move this to a Indexed DB. Do this in a way we can reuse the same table
for more such ad-hoc keys.
See code comments for the why and how.
**Tests**
- [x] Normal login
- [x] Normal login but after entering incorrect password once
- [x] Login after changing password
- Superceded by next item: ~~Change password on different browser,
opening tab in earlier browser shows logout prompt~~
- [x] Change password on different browser (with logOutOtherDevices:
false), opening tab in earlier browser transparently logs in
- [ ] Same case, but even if earlier browser was already on the enter
password page
- [x] Change password on same browser, then open another tab. Doesn't
prompt to logout.
- [x] Fresh signup
## Description
- Remove cooldown timer in FaceMlService
- Only load face ML models when actually doing indexing
- Small refactor of FaceMlService
## Tests
Tested in debug mode on my pixel phone.
This caused the reference counts to not be zero when we'd go to clear
the cache in `clearPendingUploads`.
Bug introduced in the nightly build, but didn't have any negative impact
except printing an error in the logs because of the unhandled promise
rejection.
Ref: https://github.com/nodejs/node/issues/10871#issuecomment-650150155