thread-safe Gearman client

part 1: fc753ebb7fe601346f6feed74d7a1a0598b2449e