goraft/raft — pull request #211 by unihorn (2014-04-01 17:37:38+00:00)
Title: fix: wait for all goroutines to finish before Stop

Changes are as follows:

1. Use wait group to wait all goroutines to finish before Stop
2. Remove `stop` channel because its functionality could be
replaced by the wait group
3. Change `stopped` type to `chan bool`, considering it doesn't
need to transfer `stop`
4. Make `send` function also notified by `stopped`, and cancel the request
when stopped
5. Error handling in HTTP handler functions which is caused by
canceling requests

This is inspired by coreos/etcd#645
@xiangli-cmu @benbjohnson