Clear project config cache later

When a config change lands, we clear the cached configuration for
that project before reconfiguring.  However, the reconfiguration
is not synchronous.  On a busy system, it can be a long time between
the change landing and the reconfiguration.  By clearing the cache
synchronously and performing the reconfiguration asynchronously,
any dynamic configurations created in the intervening time will
be missing data.

Instead, keep track of the project which needs to be cleared as
an attribute of the async event, and then clear the config only
immediately before reconfiguration.  This happens within the
scheduler main loop, so no other configuration actions can happen
between these two steps now.

Note, there are several changes to tests included in this change.
I used them to create a test which illustrated the bug, however,
I was only able to do so by essentially re-creating the scheduler-
internal sequence in the test itself -- essentially it represented
only the prior erroneous behavior.  So while it was useful to
confirm the source of the problem, it is not useful to confirm the
fix, and can not be included in the test suite since it always
fails.  The amount of control needed to mimic this sequence in a
test is significantly beyond our facilities at the moment.

However, some of the additional facilities I created may be useful,
so I'm adding them along with this change.

Change-Id: Id7fdd21f1646ee53986be33bdb5f1437558833ba
2 files changed