add method to get the mutability of an AllocId Miri needs this for https://github.com/rust-lang/miri/issues/2463.