Tail-recursive factorial calc (Scala).