French luxury goods companies LVMH and Hermès have ended a long-running legal dispute over the former's shareholding in the latter.