Fixes sequencing bug in junit reporter

The xUnit reporter had a bug in which dredd could exit before the final `</testsuite>` was written (but it's very system dependent, only ever saw this on linux).

This PR fixes that bug.