WDBS: safe check for window.localStorage

Sometimes access to window.localStorage property is prohibited, so the check should be wrapped into try/catch.
Fixes regression introduced in 80ccbb8 and 2262635