[MAT-437] leaks in triangular matrix code appear to be fixed.

Some messing with unique_ptr<> seems to have sorted main culprit
for leaking (the pointer switch on rewrite of data if permuted
triangular form).