BF: fix error saving zero entries in sparse matrix

I assumed obj.size was the same as np.prod(obj.shape), but this isn't so
for sparse matrices.  Fix and test.

Closes gh-2700
Merge pull request #2701 from matthew-brett/empty-sparse-fix

BUG: io: fix error saving zero entries in sparse matrix