Add generic hweight helpers

Signed-off-by: Jens Axboe <axboe@kernel.dk>
Fix _SC_NPROCESSORS_ONLN on Windows

_SC_NPROCESSORS_ONLN was returning the wrong value on Windows because
GetLogicalProcessorInformation() returns data about caches, nodes and
packages in addition to processors.

Modified by Jens to use hweight32()

Signed-off-by: Jens Axboe <axboe@kernel.dk>