Add utility to check for non migrated legacy db (#4055)
* Add utility to check for non migrated legacy db
* code review changes
* add unit tests for existsAndIsNotMigrated
* ensure indexeddb is clean for each state
(cherry picked from commit f94dbdec0fd8fa2043f04a06bdeb9a02665841c9)