(#1583) - properly destroy idb (and websql)

probably needs a test to avoid this happening again