Use done channel to avoid goroutine leak
Use done channel to avoid goroutine leak

This deals with a memory leak, caused by goroutines, experienced when using the
s3 driver. Unfortunately, this section of the code leaks goroutines like a
sieve. There is probably some refactoring that could be done to avoid this but
instead, we have a done channel that will cause waiting goroutines to exit.

Signed-off-by: Stephen J Day <63efd86fa22882ae89b6027b22a36e4db1f4214d@docker.com>

thaJeztah/distribution,thaJeztah/distribution