The StdioWrapper type is really just a pair of io.WriteClosers, so remove it in favor of a function that returns two of those. Test coverage increases because the removed code was not tested.
Instead of looping to find line breaks, make it look for the last one.