DataSet::guessChunking: throw InvalidRank for empty NDSize

Currently we just threw "1". Includes a test.