Trap localStorage errors when checking for support