fix xunit NaN on failure. #894

The fix for issue xunit reporter problem when the test fails does not solve the problem. The time=NaN is on testcase not in testsuite. So I also made the same change in test function :

FROM : time: (test.duration / 1000)   
TO:       time: (test.duration / 1000) || 0