Daily Mail legal chief quits after 17 years at the helm