correctly catching exceptions around window.localStorage calls, otherwis...

...e window.localStorage calls can crash iframed applications using flight