Fix cpu_count() on some platforms