Bug 838995: Improve component swapping when reading texture in RGBA format r=vlad

The function SwapRAndBComponents spends a lot of time in the loops while
walking over the image data. This patch reworks the looping such that the
function only takes 75% of its original time.