Matrix: Fixed kernels for transposition in OpenCL and CUDA.

Definitely needs better testing, this was only caught in triangular solvers.