raftLog: enhance check in compact

@xiangli-cmu @bmizerany 
add a function call isOutOfAppliedBounds?