Fix registry deadlock

`r.loop()` was holding a lock on the registry. While holding that lock, it was sending to a channel that executed code that blocked waiting for that lock to be released. Because of this `r.loop()` would block forever: it could not execute all of its sends because the initial send would block the `for-select` loop in `handleContainerStream` in `api.go`.

Reverting to the previous code in `registry.go` causes the test to fail. The actual implementation of how to fix this is up for debate.