fix for bitfields of non-multiple-of-8 length; previously a buffer of say size 13 would incorrectly yield a 3-byte bitfield, whereas with this change it correctly yields a 2-byte bitfield by rounding up to the next multiple of 8 as opposed to naively adding 8 and then rounding up