Bug in IO libraries when sending data through a pipe?