Moved GetNumCores to OS

Please verify the posix implementation, for I can't