Bound output-pipe drain after a child exits
A wrapper waiting for a child’s close event can hang after its exit event if a descendant retains an inherited output pipe. Capture the exit status separately, allow a short bounded drain, then terminate the wrapper-owned process group and fail if close never arrives. Give the wh…