virttest: Update the code to get the command status

The original code can not handle negative number.

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