Prevent js errors due to browser storage setItem / removeItem when browser in privacy mode

If mobile safari is in privacy mode attempting to call setItem or removeItem on localStorage and sessionStorage will throw a js error:

QUOTA_EXCEEDED_ERR: DOM Exception 22: An attempt was made to add something to storage that exceeded the quota.