raftLog: compact committed entries only

compact MUST happen on entries that have been committed, or
it may screw up the log by setting wrong commitIndex.