The National Association of Realtors is parting ways with its longtime legal chief after a bruising two years marked by legal setbacks and internal turmoil.