Refactor th to have one gearman worker thread

Change-Id: I78f95a67b80ce0627b4a3bbb20578f3d16028714