Ensure we succeed at constructing new sparse and dense arrays.

We could conceivably fail (in the presence of exceptions) to construct
the new dense array after constructing and replacing the sparse array.

Change-Id: Iacc415a2667e4350d8eae57e42a2be81e89dd8e0
Reviewed-on: https://code-review.googlesource.com/c/37392
Reviewed-by: Paul Wankadia <junyer@google.com>
2 files changed