Fix IDBFS for webworkers

It's dangerous to access `indexedDB` as a global object, as it will throw if not present. Should check `typeof indexedDB !== 'undefined'` before.