MAINT: refactor packbits/unpackbits

Pushes the GIL release one loop outward.
The unit test does not input a Boolean array.  Just run the same test with `a.astype(np.bool_)`.