A person had to be cut free by firefighters after a car flipped onto its roof during a two-car crash in County Durham.