until(p, fn, x)
Apply the function fn to x and pass the result r to the predicate p.
If p return true, r is returned, otherwise pass r to
a recursive call to until.
Return the final value of applying the function fn to x.