More careful use of window in websql and indexeddb init.