Type inference: Fix stack overflow in @tailrec fun

Workaround https://issues.scala-lang.org/browse/SI-8767: @tailrec does
not work when the tail recursion is indirect, and does not even warn
about that.

Fixes #3.