The code was changing the rnti in the red-black tree without
removing/reinserting the context. This is wrong because the
rnti is a key of the red-black tree and you cannot change the
key in a stored item at will.
There are also modifications of the function mac_eNB_rrc_ul_failure
which has to remove the UE in any case.
And rrc_mac_remove_ue has been changed for the case where
the UE is not found.