Made sure we allow the search goroutines to exit.

Previously, if we hit an error, the goroutines would block indefinitely
waiting for a read that would never happen.