[fix] Add sanity check for ClearLog
A seg fault could be generated if one uses Clear Maps
button at the beginning of the slam. This is because there is only one state saved in LogStates. But ClearLog
function requires to keep the two last states for the next slam iterations.
So the size of LogStates should be checked when clearing log.