Matrix: Fixed allocation behavior for A = trans(B).

Reported-by: Juraj Kabzan