ruby Mat.to_a: fix conversion error for cases where step != width*depth

this is usually the case if mat.col(n) or mat.row(n) is called