implement subscribing via database

this will make it much easier for ATCs to directly orchestrate builds,
as they won't have to proxy to each other for serving build events.

makes use of postgres's LISTEN / NOTIFY.

fetches events from the database in batches, until it yields fewer rows
than the batch size. notifications are then used to know to pick up more
events.

event handler now delegates to the engine entirely, without having to
branch on the build status.

a build also now says when it's completed, as a separate column. this
column being true means no new events will occur. (status is not enough;
a succeeded or failed build still has outputs.)

[#84527846]