Fix pipeIn so it uses only one instance of original sink

`written` in the included test originally contained only number `4`.