malloc_ncpus() shorter and more bullet proof

Any returned number of CPUs below 1 is considered invalid.
do { if() } while(0) reduced to if() else /* ; */