Changed integrate_primitive_polynomial from recursive to iterative

Solved the cases such as risch_integrate(log(x)**1001,x)

Earlier

        risch_integrate((log(x)+1)**1001,x)
        RuntimeError: maximum recursion depth exceeded while calling a Python object

Now

        risch_integrate((log(x)+1)**1001,x)
        gives answer within few seconds without any recursion limit getting exceeded
Merge pull request #1957 from cheatiiit/new1

Changed integrate_primitive_polynomial from recursive to iterative