Fixed crashing bug with getNeighborsND (wrapAround=true case)

Fixes https://github.com/numenta/nupic.core/issues/125

@scottpurdy 
Some simple comments explaining these lines would be useful.