Fix #904: Use trampolining to eliminate CPS recursion in optimizer

This should take a by-name param, just like `tailcall` does. I checked that turning a byname param into a lambda (with `() => tailrec` does not add an indirection. See:
```scala
object Test {
  def main(args: Array[String]): Unit =
    foo(println(5))

  def foo(body: => Unit): Unit =
    bar(() => body)

  def bar(body: () => Unit): Unit =
    body()
}
```
`$ scalac -Xprint:uncurry Test.scala`
(look at the body of `foo`)
```scala
[[syntax trees at end of                   uncurry]] // Test.scala
package <empty> {
  object Test extends Object {
    def <init>(): Test.type = {
      Test.super.<init>();
      ()
    };
    def main(args: Array[String]): Unit = Test.this.foo({
      @SerialVersionUID(0) final <synthetic> class $anonfun extends scala.runtime.AbstractFunction0[Unit] with Serializable {
        def <init>(): anonymous class $anonfun = {
          $anonfun.super.<init>();
          ()
        };
        final def apply(): Unit = scala.this.Predef.println(5)
      };
      (new anonymous class $anonfun(): () => Unit)
    });
    def foo(body: () => Unit): Unit = Test.this.bar(body);
    def bar(body: () => Unit): Unit = body.apply()
  }
}
```