Diocese of Buffalo and New York Attorney General reach agreement to settle lawsuit