The United States and Turkey pulled back from the brink of a potentially disastrous crisis on Friday, agreeing to normalize badly strained relations over Syria and other issues that had threatened the NATO allies’ longstanding ties.