raftLog: enhance check in compact

@xiangli-cmu @bmizerany 
sure. it makes the code much clear