Fix Python 2 compatibility for `sys.stdout`.

There's no `buffer`, so this part fails to load.  Tested with Python 2.7
(where it previously failed for me) and Python 3.2.