Improve os detection

`has('mac')` and `has('macunix')` are not alone enough to assert whether
the OS is running OSX. Further system calls maybe necessary to check.