nir/opt_deref: Properly optimize ptr_as_array derefs