testtopng.py: reopen stdout in binary mode on Windows to prevent
.png corruption on redirect into file