Fix detection of localStorage in IE8