Bug 901309 - Fix issues with device storage in mediadb.js

r? @dhylands

https://bugzilla.mozilla.org/show_bug.cgi?id=901309