Change test to avoid race condition

The old way of testing this had a race condition if the gearman srever
didn't reply at the right time. Now it's a true unit test so we can
avoid these issues.
Merge pull request #27 from Clever/avoid-test-race

Change test to avoid race condition