LocalStorage/sessionStorage: Added try/catch blocks around localStorage and sessionStorage setItem calls to address BlackBerry 10 issue (related to #4110)