Proposal: Add basic build cancellation

Cancelling the build is a desirable function. For example, let's say one wanted
to hook up inotify to trigger a build/run cycle when code was edited. At the
moment if there were multiple changes in quick succession, you would end up
with many in-flight builds contending with each other, and no way to cancel
them other than restarting the docker daemon.

This PR has been optimised for being the smallest useful change. It does not
represent the full changes needed to cancel in all circumstances yet. That
will come later, first I hope to disseminate some understanding of how to
achieve this.

Currently it only allows cancellation during the command running phase. If the
command is a `RUN` statement, the container is killed. Other statements are
not currently interrupted but instead the build is cancelled just before
the next statement.

Cancellation can be used by non-docker clients by cancelling the http request.
There is an example of how to do that here:

https://github.com/fsouza/go-dockerclient/pull/183

---

Add the capability to cancel the build by disconnecting the client.

This adds a `cancelled` channel which is used to signal that a build
should halt. The build is halted by sending a Kill signal and noticing
that the cancellation channel is closed.

This first pass implementation does not allow cancellation during a
pull, but that will come in a subsequent PR.

See also:
https://github.com/docker/docker/issues/3654
https://github.com/docker/docker/issues/6928

Next on my TODO list will be to implement the same thing in a similar style
for `docker pull`, if this PR is accepted. That change will automatically
make the pull phase of builds cancellable, too.

Docker-DCO-1.1-Signed-off-by: Peter Waller <p@pwaller.net> (github: pwaller)
Hm, I've just realised this is racy, since if two goroutines get here simultaneously, they would both see `job.cancelled` is not closed yet and both attempt to close it. We can protect the close with a `sync.Once`, but I'd first like input from anyone else what they think the desirable behaviour here is with respect to whether to allow multiple cancellations or not. (Here they are currently disallowed).