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.
indeed.. better implement the db optimization of the resultspec