Fix bug with removing a failed job

A recent change in I96195cb9996b01075e3705b6cd89a9863528898e added
code to re-set build states for changes during a re-enqueue to
ensure that any side effects (such as marking new builds as skipped)
occurred.  However, we have found that if a change has a
non-succeeding build and the job for that build is removed, then
this new code will run and attempt to perform a lookup on the removed
job, fail, and raise an exception that aborts reconfiguration.

Correct this by fully removing builds from their build sets when
the corresponding job is removed so that no further processing
happens on them.

Change-Id: I2d5cc8f4c5b73d6a2b184cd21016943b8c08949d
3 files changed