Rework when GRAB_JOB is sent.

* Send GRAB_JOB after NO_OP.
* Send GRAB_JOB after initial setup to start the event-state system.
* Don't send GRAB_JOB after changing the functions.  The gearman server will
  maintain the existing state of the connection if functions change, so if
  we are sleeping, we will still get appropriate NOOP messages even after
  changing functions.
* Don't send GRAB_JOB when the task queue is empty.  The event-state system
  should send it when necessary.
* Send GRAB_JOB after job completion (to restart the event-state system).

Fixes 1183454.

Also fixes cases where we would end up grabbing multiple jobs in one cycle.

Change-Id: I36a890711ecdfef62a6554bac820acf0ca8b5f5b