avoid closing the log while the leader is still running.
avoid closing the log while the leader is still running.

if the log is closed there's a chance that the leader is flushing to
one of the peers and will try to access the logs and cause the
following panic:

goroutine 595 [running]:
github.com/influxdb/raft.(*Log).getEntriesAfter(0xc20023d7e0, 0xa, 0x7d0, 0x0, 0x0, ...)
	/home/vagrant/influxdb/src/github.com/influxdb/raft/log.go:259 +0x2f4
github.com/influxdb/raft.(*Peer).flush(0xc2001f75a0)
	/home/vagrant/influxdb/src/github.com/influxdb/raft/peer.go:154 +0x150
github.com/influxdb/raft.(*Peer).heartbeat(0xc2001f75a0, 0xc2001f7660)
	/home/vagrant/influxdb/src/github.com/influxdb/raft/peer.go:146 +0x3a7
created by github.com/influxdb/raft.(*Peer).startHeartbeat
	/home/vagrant/influxdb/src/github.com/influxdb/raft/peer.go:84 +0x78

influxdb/raft