Use binary mode when writing spectrogram to stdout

Set standard output to binary mode before writing a spectrogram there.
Necessary for Windows.