Make localStorage use resilient

localStorage.setItem is liable to fail even if localStorage feature detection
indicates the browser supports localStorage. This can happen, for example, if
localStorage is full. This mandates that any attempt to set a key in
localStorage must be enclosed in a try / catch block. Since that is the case,
it is silly to have a separate feature detection function that does the same
thing. So combine the try / catch with the actual event storage.

Bug: 64716
Change-Id: I92de39ec0cca0c3dc5bb476f746adde2e59271e4