Fix database error undefined on Chrome and count returns IDBRequest instead of result

How about a function then?
```
var databaseErrorMessage = function (error) { 
  return e.target.webkitErrorMessage || e.target.error.message;
}
```