Close down the input pipe correctly at end of input.