Use sysctl to determine the number of cpu cores on darwin

  * Mountain Lion does not support hwprefs

Signed-off-by: Kris Kelly <kkelly@pivotallabs.com>
Test general case for num_cores command failing

Signed-off-by: Kris Kelly <kkelly@pivotallabs.com>