raftLog: enhance check in compact

@xiangli-cmu @bmizerany