Fix unknown host exception in junit xml listener.

Fixes #1506
Merge pull request #1512 from sbt/wip/fix-1506

Fix unknown host exception in junit xml listener.