Refactor housekeeping when a master stops

Handle stopped masters (whether expired or normal shutdown) within the
data API.  Be careful to stop steps and logs as well as builds and build
requests, and do so with the data API.
I want to leave that for a followup, though -- I'll file a bug