Wait for IO copying to complete before deleting the exec process. Delete
cancels outstanding IO operations, which can truncate the output.
```
=== NAME TestContainerExecLargeOutputWithTTY
container_test.go:1990: process output does not end with "999999 1000000" at iteration 1, here are the last 20 characters of the output:
"1150 991151 991152 9"
--- FAIL: TestContainerExecLargeOutputWithTTY (2.00s)
```
In a follow-up, we should add comment for Delete API and document that the
caller should take responsibility to drain IO before Delete.
Signed-off-by: Wei Fu <fuweid89@gmail.com>
(cherry picked from commit 68f92da9fb)
Signed-off-by: Samuel Karp <samuelkarp@google.com>