Do more checking before speshing arg unboxing.

We could end up trying to unbox a num as an int before. While we can
spesh that situation, for now just make sure we apply the transform
when it really is safe.