etcdserver/etcdhttp: split out peers and add tests

@jonboulle The mistake that I made before was to use defer in a forever-running loop, and it eats all memory.