Move kcalloc outside spinlock.

Thanks to Jonathan Herbst for pointing this out.