Thomas comeback seals PGA victory after Pereira collapse