Wait for responses to some requests.

SUBMIT_JOB (and related) requests as well as OPTION_REQ requests
always return a response (success or error), so have the client
wait for a response and handle errors appropriately.

Since they can both return ERROR packets, and the gearman protocol
has no mechanism to associate ERROR responses with the requests
that triggered them, put each task that may trigger an error response
in a fifo queue and assume that what we get back is in the same order.

The only other commands (properly executed) that can trigger an ERROR
response are the WORK_ requests, which are only sent by workers, not
clients.

If anything about the packet sequencing seems out of order (eg, we get
a successful response that doesn't match the next item on the fifo
queue) restart the connection (there is likely no way to recover).

Change-Id: Ibca972f5d57313cebba028ed473273f46fa68e2a