Fix get_affinity for linux

This pull request fixes get_affinity under linux to properly deal with the scheduler CPU bitmask.