Fix where the tests import StringIO from on Python 2

This avoids a unicode based TypeError which doesn't show up in
real usage.