[API]: Fix pool empty and delete handling

1. If pool is empty catch the error before we cause a bad exception
2. If a device is building and stuck waiting on gearman don't allow a
delete because it causes some funky stuff to happen
3. Don't mark a device 'ONLINE' until it really is (so rebuild monitoring
doesn't trigger early)
4. Catch empty LB UPDATE command before the worker does and mark in logs

Change-Id: Ibc5c163251e585c6b106a1489fe393099fa7461f
[API] allow deletion of LBs in an ERROR state

Change-Id: I45540915ae2038d11df83f2b4e5f13da226cba2f