Backport the Coverity fixes from Crosswalk 11.

This patch series backports the patches from #2631 to the crosswalk-9
branches. There were very few conflicts, but I had to backport commit
4cad5b3b584789b42727620c868c8ca395234c21 due to the amount of style
changes it made that were causing several problems for the other
cherry-picks.

BUG=XWALK-2928