The New Saints have won the Cymru Premier title for a 17th time - after rivals Penybont failed to beat Cardiff Met.