Rotate a matrix by 90 degrees