Master waits on slave setup completion

The master no longer sends subjobs immediately after triggering build
setup on the slave. The slave now executes build setup, then notifies
the master of whether setup was successful or not. If successful, then
the master starts sending subjobs to the slave.

If setup failed, currently the master will tell the slave to shut down
but we'll change this in a future commit to just reset the slave.

As part of this change, I also refactored how the slave sends "idle"
and "disconnect" notifications to the master. Previously "idle" and
"disconnect" were their own API endpoints. Now the slave does a PUT
on a slave state field. This, besides being more "restful", is more
extensible if we want to add more state notifications in the future.

This change fixes a bug where if build setup failed on the slave, the
slave would shut down completely. (This is actually still the behavior,
but now it is more explicit and we can easily change the behavior in a
future commit.)
This is great, makes me want to refactor my handle_build_state_update.  Do you think connect_new_slave() should call handle_slave_state_update() instead of _add_idle_slave() directly?