Prevent BDCSVD crash caused by index out of bounds.
For a large matrix of ones, we end up trying to access perm(-1), which
causes a memory access error and crash.
Added a basic check for this case, and force zhat to zero, in an
attempt to continue. Reports a numerical issue.
Related to #2491 (closed)