Limit the amount of work done while bootstrapping thrift.

Reviewed at https://reviews.apache.org/r/26720/