Recursion-free Array#permutation and combination (mri #9932).