Ensure the formation mutex is locked when rectifying

Signed-off-by: Lewis Marshall <lewis@lmars.net>
Add scheduler back off policy when restarting jobs

Signed-off-by: Lewis Marshall <lewis@lmars.net>
Update fake cluster to emit appropriate host events

Signed-off-by: Lewis Marshall <lewis@lmars.net>
Test job restart backoff policy

Signed-off-by: Lewis Marshall <lewis@lmars.net>
Use nil event to mark start of watchHost routine

Signed-off-by: Lewis Marshall <lewis@lmars.net>
Don't leave a Mutex locked!

Signed-off-by: Lewis Marshall <lewis@lmars.net>
Ensure scheduler tracks jobs before they actually start

This avoids races where host start events are received before the job
has been added to the scheduler's jobs (in which case the event would be
ignored)

Signed-off-by: Lewis Marshall <lewis@lmars.net>
Merge pull request #22 from flynn/flap-detection

Flap detection