Avoid destroying sys.stdout.

Fixes #74

This removes the manipulation of the Python-level `sys.stdout` object so that it is still valid after `_get_saved_buf` is done.