go fmt
Fix concurrency issues

The program completely broke on Go 1.1-RC2 because main didn't wait for
goroutines to finish.
Check for read error earlier