Edited nmod_mat_pow to eliminate the last squaring