The fix for
IMPALA-10127 introduced an issue in this code:
RemoveFromUnprotectedList would detect that this is the last unprotected entry and clear unprotected_list_front_. This doesn't decrement num_unprotected_ to 0, so when AddToUnprotectedList is called, it doesn't set unprotected_list_front_ when it adds the element back.
This only applies when there is exactly one entry on the unprotected list. This can be fixed by either decrementing/incrementing the counters to match up with other locations or by skipping this code when num_unprotected_ == 1.