Rework core detecting

Bugfixes:
  * handle case when NUMBER_OF_PROCESSORS is empty string

Features:

  * support using NUMBER_OF_PROCESSORS to override detection on EVERY os

  * handle *BSD group along with Dragonfly BSD

Minor cleanup / tweaks / improvements:

  * avoid setting @cores if it's going to be returned anyway

  * use IO.read + exception handling instead of File.exist?

  * group tests by os type

  * test showing error (stderr)

  * use sysctl '-n' parameter to make things more robust