Fix some unicode errors

This fixes a series of issues.  It starts by fixing some Python 2.4 incompatibilities, then builds on those to fix some capture issues in xunit and the failuredetail plugin.