indexeddb: close database before attempting to delete it