Fix possible race condition.

Had something to do with go routines. When run() goroutine  is called,
we might not finish it and pass in something into register channel
right away.