Fix Private Browsing in Safari.

In Safari's Private Browsing mode calls to Local Storage's setItem
are disallowed.

Local Storage is being used to maintain some global state along with
peristance so optionally fall back to a local variable when persistence
isn't available.

See also: https://gist.github.com/paulirish/5558557