Look for encoding of original stdout

As things like nose plugins can swap out sys.stdout
with StringIOs which don't have encodings.  Verified
this passes on windows with nose plugins enabled.