Use close(chan) idiom for stopping consumer's goroutines