[MONDRIAN-1432]  ArrayIndexOutOfBoundsException in DenseObjectSegmentDataset.getObject

'0' and NULL values in segments were being mishandled in some cases.
This is a merge of Julian's changes from master branch.
(cherry picked from commit 30889d5)
Merge pull request #315 from mkambol/mondrian-1432

[MONDRIAN-1432]  ArrayIndexOutOfBoundsException in DenseObjectSegmentDataset.getObject