ctags: kill subprocess on scanner errors

github.com/sirthias/borer contains a JSON file with 100k '[' chars,
This caused a "token too long" error from bufio, which left the
subprocess alive. Before, we waited for the subprocess to die, which
never happened.

This will now cause the indexing to fail for a single repo, but that
is better than stopping the complete indexing pipeline.

Fixes #85.

Change-Id: I4ee370ae5e531fc8fde0256eac3d280771594c73
diff --git a/ctags/json.go b/ctags/json.go
index ff27fd0..0e3a9e5 100644
--- a/ctags/json.go
+++ b/ctags/json.go
@@ -82,10 +82,11 @@
 
 func (p *ctagsProcess) read(rep *reply) error {
 	if !p.out.Scan() {
-		// capture exit error.
-		err := p.cmd.Wait()
-		p.outPipe.Close()
-		p.in.Close()
+		// Some errors (eg. token too long) do not kill the
+		// parser. We would deadlock if we waited for the
+		// process to exit.
+		err := p.out.Err()
+		p.Close()
 		return err
 	}
 	if debug {