Fix get_affinity for linux