Fix Python 3 handling of stdout.