Only write to pipe if we are connected to the child