fix bugs close PipeReader