Rory McIlroy was in a positive frame of mind despite failing to climb into contention in the final round of the US PGA Championship.