Afghan rivals said close to ending feud on how to share power