fix(server): release the server lock while stopping peers
fix(server): release the server lock while stopping peers

Avoid a deadlock situation:

- Server is changing the term via setCurrentTerm() which also holds
  the server.Lock

- Peer is in the flush() routine and attempts to takes the server.Lock
  via p.server.Term() in sendAppendEntriesRequest()

The peer cannot take the lock because it is held by the server. The
server is waiting for the peer to shut down. Progress stops.

Yong-Lee/influxdb,rnubel/influxdb,imcom/influxdb,opavader/influxdb,cabify/influxdb,daachi/influxdb,paulstuart/influxdb,tuxmonteiro/influxdb,mvadu/influxdb,fg2it/influxdb,trigrass2/influxdb,vladlopes/influxdb,Venu4thFeb/influxdb,cabify/influxdb,Tony133/influxdb,marcosnils/influxdb,IMCG/InfluxDB,trigrass2/influxdb,opavader/influxdb,bspline/influxdb,slavau/influxdb,kingland/influxdb,sudabon/influxdb,kingland/influxdb,brunoqc/influxdb,cannium/influxdb,lenko-d/influxdb,eminden/influxdb,jipperinbham/influxdb,alexiri/influxdb,pablolmiranda/influxdb,stvnwrgs/influxdb,mnuessler/influxdb,endophage/influxdb,GoIncremental/influxdb,evanphx/influxdb,tommymei/influxdb,sudabon/influxdb,paulstuart/influxdb,influxdb/influxdb,otoolep/influxdb,m4ce/influxdb,cannium/influxdb,roobert/influxdb,michaelsproul/influxdb,jipperinbham/influxdb,marcosnils/influxdb,mvadu/influxdb,samaitra/influxdb,nickscript0/influxdb,Venu4thFeb/influxdb,pdf/influxdb,bluebreezecf/influxdb,linfangrong/influxdb,no2key/influxdb,Yong-Lee/influxdb,jonseymour/influxdb,marcosnils/influxdb,samaitra/influxdb,wxdublin/influxdb,wxdublin/influxdb,jonseymour/influxdb,n1tr0g/influxdb,fg2it/influxdb,ASAPPinc/influxdb,m4ce/influxdb,kingland/influxdb,mnuessler/influxdb,lgpeterson/influxdb,toorop/influxdb,timraymond/influxdb,brunoqc/influxdb,runcom/influxdb,mengjinglei/influxdb,bluebreezecf/influxdb,runner-mei/influxdb,fxstein/influxdb,Ancillas/influxdb,stvnwrgs/influxdb,s7v7nislands/influxdb,otoolep/influxdb,mark-rushakoff/influxdb,pablolmiranda/influxdb,nickrobinson/influxdb,atyenoria/influxdb,alexiri/influxdb,mark-rushakoff/influxdb,timraymond/influxdb,paulstuart/influxdb,cannium/influxdb,mre/influxdb,atyenoria/influxdb,cnelissen/influxdb,mcanthony/influxdb,jgeiger/influxdb,apriendeau/influxdb,hyperworks/influxdb,Ancillas/influxdb,slachiewicz/influxdb,mvadu/influxdb,mre/influxdb,stvnwrgs/influxdb,runner-mei/influxdb,opavader/influxdb,mengjinglei/influxdb,timraymond/influxdb,cnelissen/influxdb,samaitra/influxdb,IMCG/InfluxDB,bspline/influxdb,nickscript0/influxdb,mre/influxdb,Mindera/influxdb,jportoles/influxdb092,endophage/influxdb,fxstein/influxdb,influxdb/influxdb,radcheb/influxdb,otoolep/influxdb,eminden/influxdb,nickscript0/influxdb,josephcopenhaver/influxdb,bluebreezecf/influxdb,bluebreezecf/influxdb,GrimDerp/influxdb,archsaber/influxdb,cabify/influxdb,rnubel/influxdb,fg2it/influxdb,lenko-d/influxdb,arussellsaw/influxdb,Mindera/influxdb,apriendeau/influxdb,toorop/influxdb,pdf/influxdb,yonglehou/raft,dneuman64/influxdb,eminden/influxdb,mvadu/influxdb,josephcopenhaver/influxdb,joaopedrotaveira/influxdb,fg2it/influxdb,jipperinbham/influxdb,n1tr0g/influxdb,luciotorre/influxdb,archsaber/influxdb,radcheb/influxdb,archsaber/influxdb,jgeiger/influxdb,fxstein/influxdb,ninjasphere/influxdb,marcosnils/influxdb,Mindera/influxdb,luciotorre/influxdb,evanphx/influxdb,fxstein/influxdb,apigee/influxdb,mash0304/influxdb,li-ang/influxdb,mcanthony/influxdb,influxdb/influxdb,joaopedrotaveira/influxdb,otoolep/influxdb,no2key/influxdb,DanielMorsing/influxdb,Wikia/influxdb,tommymei/influxdb,brunoqc/influxdb,evanphx/influxdb,jipperinbham/influxdb,daachi/influxdb,DreamLee471/raft,luciotorre/influxdb,121watts/influxdb,paulstuart/influxdb,n1tr0g/influxdb,slavau/influxdb,apigee/influxdb,Sotfo/influxdb,sudabon/influxdb,jonseymour/influxdb,nickrobinson/influxdb,influxdb/influxdb,apigee/influxdb,cannium/influxdb,sudabon/influxdb,tjyang/influxdb,rnubel/influxdb,wxdublin/influxdb,cabify/influxdb,nckturner/influxdb,samaitra/influxdb,DanielMorsing/influxdb,n1tr0g/influxdb,bspline/influxdb,ASAPPinc/influxdb,alex-quiterio/raft,influxdata/influxdb,1d4Nf6/raft,m4ce/influxdb,mvadu/influxdb,roobert/influxdb,Ancillas/influxdb,mark-rushakoff/influxdb,no2key/influxdb,pdf/influxdb,radcheb/influxdb,rnubel/influxdb,endophage/influxdb,cnelissen/influxdb,luciotorre/influxdb,Tony133/influxdb,CVTJNII/influxdb-tjnii,Mindera/influxdb,cnelissen/influxdb,imcom/influxdb,ASAPPinc/influxdb,influxdata/influxdb,slachiewicz/influxdb,runner-mei/influxdb,mcanthony/influxdb,runner-mei/influxdb,slavau/influxdb,roobert/influxdb,jgeiger/influxdb,Tony133/influxdb,tuxmonteiro/influxdb,tjyang/influxdb,nckturner/influxdb,jonseymour/influxdb,fengshao0907/raft,archsaber/influxdb,slavau/influxdb,otoolep/influxdb,pablolmiranda/influxdb,atyenoria/influxdb,nporsche/raft,tommymei/influxdb,nckturner/influxdb,ezotrank/influxdb,radcheb/influxdb,tommymei/influxdb,opavader/influxdb,linearb/influxdb,apigee/influxdb,CrazyJvm/influxdb,jportoles/influxdb092,haim0n/influxdb,lgpeterson/influxdb,pkittenis/influxdb,runcom/influxdb,mash0304/influxdb,GoIncremental/influxdb,kingland/influxdb,linfangrong/influxdb,sudabon/influxdb,jportoles/influxdb092,josephcopenhaver/influxdb,GrimDerp/influxdb,trigrass2/influxdb,atyenoria/influxdb,mengjinglei/influxdb,nickscript0/influxdb,pablolmiranda/influxdb,121watts/influxdb,Venu4thFeb/influxdb,brunoqc/influxdb,CVTJNII/influxdb-tjnii,arussellsaw/influxdb,fg2it/influxdb,jgeiger/influxdb,apriendeau/influxdb,endophage/influxdb,michaelsproul/influxdb,ezotrank/influxdb,GoIncremental/influxdb,chenziliang/influxdb,lenko-d/influxdb,apigee/influxdb,trigrass2/influxdb,Wikia/influxdb,daachi/influxdb,DanielMorsing/influxdb,sudabon/influxdb,vladlopes/influxdb,neonstalwart/influxdb,chenziliang/influxdb,CVTJNII/influxdb-tjnii,imcom/influxdb,Sotfo/influxdb,Mindera/influxdb,ninjasphere/influxdb,imcom/influxdb,chenziliang/influxdb,no2key/influxdb,nickscript0/influxdb,egymgmbh/influxdb,jportoles/influxdb092,haim0n/influxdb,mash0304/influxdb,100star/influxdb,tuxmonteiro/influxdb,timraymond/influxdb,tuxmonteiro/influxdb,linearb/influxdb,gdi2290/influxdb,m4ce/influxdb,opavader/influxdb,nckturner/influxdb,mre/influxdb,Sotfo/influxdb,bluebreezecf/influxdb,mark-rushakoff/influxdb,pablolmiranda/influxdb,benbjohnson/influxdb,lgpeterson/influxdb,Mindera/influxdb,runcom/influxdb,josephcopenhaver/influxdb,roobert/influxdb,michaelsproul/influxdb,ezotrank/influxdb,runcom/influxdb,mmaul/influxdb,egymgmbh/influxdb,chenziliang/influxdb,mnuessler/influxdb,mmaul/influxdb,m4ce/influxdb,Venu4thFeb/influxdb,eminden/influxdb,alexiri/influxdb,vladlopes/influxdb,influxdb/influxdb,tuxmonteiro/influxdb,linearb/influxdb,mmaul/influxdb,IMCG/InfluxDB,slachiewicz/influxdb,daachi/influxdb,jonseymour/influxdb,li-ang/influxdb,ASAPPinc/influxdb,joaopedrotaveira/influxdb,neonstalwart/influxdb,brunoqc/influxdb,jipperinbham/influxdb,DanielMorsing/influxdb,timraymond/influxdb,mnuessler/influxdb,Wikia/influxdb,alexiri/influxdb,slavau/influxdb,mre/influxdb,toorop/influxdb,Wikia/influxdb,arussellsaw/influxdb,joaopedrotaveira/influxdb,goraft/raft,Sotfo/influxdb,Yong-Lee/influxdb,egymgmbh/influxdb,daachi/influxdb,roobert/influxdb,nooproblem/influxdb,mnuessler/influxdb,tjyang/influxdb,apriendeau/influxdb,CrazyJvm/influxdb,lgpeterson/influxdb,wxdublin/influxdb,pkittenis/influxdb,haim0n/influxdb,Ancillas/influxdb,mash0304/influxdb,influxdb/influxdb,michaelsproul/influxdb,neonstalwart/influxdb,stvnwrgs/influxdb,linfangrong/influxdb,jportoles/influxdb092,ninjasphere/influxdb,nickrobinson/influxdb,lenko-d/influxdb,pkittenis/influxdb,Tony133/influxdb,100star/influxdb,n1tr0g/influxdb,luciotorre/influxdb,nooproblem/influxdb,gdi2290/influxdb,linearb/influxdb,jonseymour/influxdb,daachi/influxdb,vladlopes/influxdb,s7v7nislands/influxdb,nckturner/influxdb,josephcopenhaver/influxdb,haim0n/influxdb,mvadu/influxdb,nooproblem/influxdb,trigrass2/influxdb,121watts/influxdb,mmaul/influxdb,Ancillas/influxdb,m4ce/influxdb,GrimDerp/influxdb,Wikia/influxdb,bspline/influxdb,CrazyJvm/influxdb,radcheb/influxdb,jgeiger/influxdb,s7v7nislands/influxdb,paulstuart/influxdb,otoolep/influxdb,mash0304/influxdb,endophage/influxdb,cabify/influxdb,s7v7nislands/influxdb,slachiewicz/influxdb,GoIncremental/influxdb,ezotrank/influxdb,evanphx/influxdb,tommymei/influxdb,arussellsaw/influxdb,shelmesky/raft,arussellsaw/influxdb,imcom/influxdb,CVTJNII/influxdb-tjnii,no2key/influxdb,pkittenis/influxdb,linfangrong/influxdb,stvnwrgs/influxdb,hyperworks/influxdb,benbjohnson/influxdb,121watts/influxdb,lenko-d/influxdb,runcom/influxdb,ninjasphere/influxdb,linfangrong/influxdb,benbjohnson/influxdb,lgpeterson/influxdb,mcanthony/influxdb,pdf/influxdb,slachiewicz/influxdb,mark-rushakoff/influxdb,pdf/influxdb,samaitra/influxdb,ninjasphere/influxdb,toorop/influxdb,n1tr0g/influxdb,apriendeau/influxdb,dneuman64/influxdb,nickrobinson/influxdb,nickrobinson/influxdb,alexiri/influxdb,mengjinglei/influxdb,wxdublin/influxdb,Sotfo/influxdb,fxstein/influxdb,dneuman64/influxdb,kingland/influxdb,GoIncremental/influxdb,dneuman64/influxdb,jipperinbham/influxdb,pkittenis/influxdb,Yong-Lee/influxdb,neonstalwart/influxdb,hyperworks/influxdb,mark-rushakoff/influxdb,nooproblem/influxdb,jgeiger/influxdb,CVTJNII/influxdb-tjnii,apigee/influxdb,Tony133/influxdb,toorop/influxdb,hyperworks/influxdb,pkittenis/influxdb,cnelissen/influxdb,Venu4thFeb/influxdb,hyperworks/influxdb,egymgmbh/influxdb,mcanthony/influxdb,Yong-Lee/influxdb,samaitra/influxdb,arussellsaw/influxdb,joaopedrotaveira/influxdb,egymgmbh/influxdb,DanielMorsing/influxdb,benbjohnson/influxdb,rnubel/influxdb,gdi2290/influxdb,atyenoria/influxdb,michaelsproul/influxdb,mmaul/influxdb,linearb/influxdb,GrimDerp/influxdb,eminden/influxdb,marcosnils/influxdb,ASAPPinc/influxdb,nooproblem/influxdb,CVTJNII/influxdb-tjnii,tjyang/influxdb,bspline/influxdb,100star/influxdb,mnuessler/influxdb,GrimDerp/influxdb,dneuman64/influxdb,CrazyJvm/influxdb,coreos/raft,IMCG/InfluxDB,IMCG/InfluxDB