Pinsent Masons has elected its first female managing partner after a contested election, as more law firms diversify their upper echleons.