refactor(peer): cleanup of some if boolean logic

I always get confused reading this code. Lets make it more clear, if
flush then flush; else don't flush.
fix(log): use Rlock in getEntriesAfter

getEntriesAfter only reads the log and doesn't make any motifications.
Using an RLock is safe here.
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.
Merge pull request #175 from philips/cleanup-locks-in-peer

Cleanup locks in peer