detect core count on OSX/FreeBSD.