Compute the last register index correctly

Inlining changed the size of the work buffer, so it had
to be recomputed. Unfortunately I'm not able to use the
recomputed value in the spesh candidate as that structure
is unavailable to the JIT.