Fix: do_task must wait until the task has been finished

This bug has already been fixed here: https://github.com/gearman-ruby/gearman-ruby/pull/6 and landed in the release 3.0.5. But this release is no more available and the bug is there again.