Fix up BuildTreeFn to catch DistributeExampleFn logic, and handle case of extreme number of trees or extremely few samples. Standardize with non-distributed version.