Fixed use of IndexedDB to be more robust and not try deleting the database (which causes problems with re-creating it, at least in Chrome)