pngtool: fix for binary read/write on windows