Added additional checks to make sure localStorage is really supported

Fixes private browsing QUOTA_EXCEEDED_ERR issue in Safari.

Currently Safari (in OSX or iOS) will throw an exception if you try to call the setItem method while in Private Browsing mode.