Ireland clinch their 14th Triple Crown and remain on course for a third successive Six Nations title after beating a resurgent Wales in a Cardiff thriller.