generic.tests: Update the method get ncpu from server

Sometime the output from server include some unexpect letters include
some numbers. So the old method will failed to get the correct cpu
number.

Signed-off-by: Yiqiao Pu <ypu@redhat.com>