Barcelona is carefully planning the future of its rising star, Lamine Yamal, to avoid repeating past contract mistakes, particularly those that led to Lionel Messi’s eventual departure.