Handle the case of no-access-to-localStorage.

Prevent visible exceptions from being thrown when window.localStorage access is prohibited.