Use fwrite(STDOUT, ...); instead of printf(), to get around output buffers (closes #38).