sched_getaffinity(3): more compatibility with Linux
(cherry picked from commit 67fc95025ccfc696ea5eaea0ecb1fff295760723)