Pope Leo has sought to encourage French Catholics to persevere in their faith “even amid the thorns” of a secular world during his four-day visit.