implement plumbing for aborting builds

a build now goes from pending -> scheduled -> started, rather than directly
from pending -> started. also, each state transition checks the state that
it's changing from. this is because a user may now come in and abort the build
at any moment.
implement build aborting