MAINT: refactor packbits/unpackbits

Pushes the GIL release one loop outward.
So this is a bit less general? Or did the previous version work with integer types?