Use unsigned long for bit sets

This should be more efficient on some architectures.

As a nice side effect, this is also what Linux does in some userspace
APIs, so after this change, these macros can be used for this as well
(and Linux interestingly does not provide similar macros in the
userspace headers).