Catch localStorage security exceptions. Fixes #351

This traps DOM Security Exceptions when referencing localStorage. This happens in Chrome and Firefox (at least) when configured to not allow persistent data.

More information here: http://www.w3.org/TR/webstorage/#the-localstorage-attribute