detect core count on OSX/FreeBSD.

This will allow us to run tests with more than 1 core.