execdriver: Make Config field more generic

In order to handle special configuration for other backends we
make the Config field a map to key-value arrays. This lets
us use it for lxc, by using the "lxc" key for those, and we can
later extend it easily for other backend-specific options.

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)

Conflicts:
	execdriver/driver.go
	runconfig/parse.go
cgroups: Splity out Apply/Cleanup to separate file/interface

This leaves only the generic cgroup helper functions in cgroups.go and
will allow easy implementations of other cgroup managers.

This also wires up the call to Cleanup the cgroup which was missing
before.

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
cgroups: Join groups by writing to cgroups.procs, not tasks

cgroups.procs moves all the threads of the process, and "tasks" just
the one thread. I believe there is a risk that we move the main thread,
but then we accidentally fork off one of the other threads if the go
scheduler randomly switched to another thread. So, it seems safer (and
more correct) to use cgroups.procs.

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
cgroups: Add systemd implementation of cgroups

This implements cgroup.Apply() using the systemd apis.
We create a transient unit called "docker-$id.scope" that contains
the container processes. We also have a way to set unit specific
properties, currently only defining the Slice to put the
scope in.

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
cgroup: Add ReuseCurrent option to --unit-conf

This causes docker to not create a new transient unit for cgroup
containment and resource limits. Instead it will reuse the current
cgroup and apply resource limitations to it using SetUnitProperties.

This is interesting mostly in combination with --foreground, because
it allows you to have a systemd unit file like:

[Service]
ExecStart=docker run --foreground --unit-conf ReuseCurrent=true run image
MemoryLimit=100M

With the following properties:

* Any limits and other properties set up in the service file applies
  to both the docker client and the container "as one unit".
* There is only one unit representing the service
* You can kill the service via systemd which will kill both client and
  container.
* If the client dies systemd will (first nicely then violently) kill the
  other processes in the cgroup (i.e. the container).

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
fix build error