Use CARGO_CFG_TARGET_OS instead of target_os cfg var
target_os reports the target used to build the build.rs script, while
it is needed to check which is the target used to build the crate
itself.
Partially unbreaks building for linux on a macos host.