I also noticed this problem with the indexedDBShim. If you wait a few milliseconds it works correctly so maybe you can delay your code?
I know this isn't a perfect answer but this is the error which is happening:
"could not prepare statement (1 no such table: dbVersions)"
Somehow this error is hidden (a bug in the shim), as one of the maintainers I might look into it when I have time :).
This error occurs because this code is called a bit to soon (somewhere around line 1570):
tx.executeSql("SELECT * FROM dbVersions where name = ?", [name], function(tx, data){
This table doesn't exists yet because this code isn't executed yet (around line 1494):
tx.executeSql("CREATE TABLE IF NOT EXISTS dbVersions (name VARCHAR(255), version INT);", [], function(){
In short, there isn't much you can do about it because it is a bug in the shim, delaying the code is I think the only way to fix it on your side. Another possibility is fixing the shim, but that will take some more time I think.