Top judge Katerina Sakellaropoulou became Greece’s first woman president on Wednesday when lawmakers elected her head of state in a rare display of unity.