BUG: Fix strides of trailing 1s when reshaping

When adding ones to the shape for non contiguous arrays reshapes
(i.e. either the first array is not contiguous or the the reshape
order does not match it). The strides of trailing ones were not
set. For example reshape of (6,) to (6,1,1). Previously this occured
rarely because of removed special handleing when only ones were
added or removed.
Merge pull request #2950 from seberg/issue-2949

BUG: Fix strides of trailing 1s when reshaping