get correct number of cores info in MacOSX

no /proc file system in MacOSX. use sysctl to return correct number of
cores to speed up building.

Change-Id: Ic813521c5867fd3c5ac1f565894dcb89aa1a3579