raft: compact takes index and nodes parameters

Before this commit, compact always compact log at current applied index of raft.
This prevents us from doing non-blocking snapshot since we have to make snapshot
and compact atomically. 

To prepare for non-blocking snapshot, this commit make compact supports index and nodes parameters. 

After completing snapshot, the applier
should call compact with the snapshot index and the nodes at snapshot index to do a compaction at snapshot index.
match the order at https://github.com/coreos/etcd/pull/1241/files#diff-5287710a6d77535b74d756c1f74db503R19 ?