virttest: Update the code to get the command status

The original code can not handle negative number.