[cpu_sim] Fix reading of programs on stdin