Avoid division by zero in calculation of loss rate

If there are no packets sent, print loss rate '0' instead of 'NaN'.