Add a rate limiter, use it to rate limit docker pulls.

You could still do a non-blocking read of the channel.

https://gobyexample.com/non-blocking-channel-operations

If I understand it, that would simplify this logic a lot.