Wait 2 goroutines

Original code, one goroutine may fails in following case.
 1 one goroutine sends error to channel
 2 waited function receives it from channel
 3 waited function finishes
 4 waited function closes 'nc' and 'd' in defer
 5 other goroutine fails io.Copy because 'nc' and 'd' are already closed.
Merge pull request #5 from syohex/fix-for-channel-recv

Wait 2 goroutines