update getLocalStorage/getSessionStorage check (#6079)
Closes #6050
If you are browsing private on iOS, localstorage is available but you cannot write in it. It'll throw "QUOTA_EXCEEDED_ERR: DOM Exception 22: An attempt was made to add something to storage that exceeded the quota."
This can be solved in the detection of localstorage by trying to write something in storage