BUG: bug when using chunksize and writing ndim > 2
Merge pull request #4462 from jreback/hdf_opt2

BUG: bug when using chunksize and writing ndim > 2