Changed `reshape` of a sparse matrix

Nonzero elements now copied rather than shared, to prevent
accidental corruption when inserting new elements.