Added fallback for old mocha version, waiting for stats object to be finally filled instead of outputting it immediately.