Return end-of-pipe on zero read

This fixes issue #32.