Python 2.6 support writing unicode to sys.stdout