asyncshell: refactored pipe_finish