Prefer `process.stdout.write` in xUnit reporter.

Falls back to `console.log` if `process.stdout` is unavailable.

Fixes #1068.

(This also seems to have picked up a completely unrelated change to another
file that hadn't yet made it into the mocha.js snapshot.)