BGE: Fixing a crash reported by Ace Dragon on BA. It looks like Object->totcol can give a number higher than the number of materials, so I've added some NULL checks.

git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@54837 954f8c5b-7b00-dc11-b283-0030488c597c