Follup to #2463 which fixes a regression I noticed only Python 2.7.3 down to 2.7.0.  This provides a slightly reworked fix to single out StringIO.StringIO for special treatment and leave writing to interfaces that support the modern buffer interface.
Merge pull request #2470 from embray/issue-2463-2

Follup to #2463...