iterate' n f x applies f to x n times and returns the result.
The applications are calculated strictly.