Preventing goroutine leaks