Don't use sys.stdout in git_info

In Python 2, it fails with Unicode strings. Fixes #170.