Check array boundaries to avoid the "array-bounds" error on linux

Compiling on linux causes the error "array subscript is above array
bounds [-Werror=array-bounds]". This commit adds boundary checking
using the constant defining the maximum number of items in the "nuke" array.

Signed-off-by: Roger Zanoni <roger.zanoni@openbossa.org>
Merge pull request #2349 from rogerzanoni/master

fixed #2052: [Linux] [-Werror=array-bounds] error appears when compiling Box2dTestBed.