Without this change, there was a narrow race condition that would allow writers to finish when there was still data left to write. This is likely to be what was causing some integration tests to fail with truncated pull output. Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com> Upstream-commit: 947519bfb31024ea8c76e8e303f2c338b00265f2 Component: engine