Add libdevmapper wrapper
devmapper: Add DeviceSet device-mapper helper

This is a module that uses the device-mapper create CoW snapshots
You instantiate a DeviceSetDM object on a specified root (/var/lib/docker),
and it will create a subdirectory there called "loopback". It will
contain two sparse files which are loopback mounted into
a thin-pool device-mapper device called "docker-pool".

We then create a base snapshot in the pool with an empty filesystem
which can be used as a base for docker snapshots. It also keeps track
of the mapping between docker image ids and the snapshots in the pool.

Typical use of is something like (without error checking):

devices = NewDeviceSetDM("/var/lib/docker")
devices.AddDevice(imageId, "") // "" is the base image id
devices.MountDevice(imageId, "/mnt/image")
 ... extract base image to /mnt/image
devices.AddDevice(containerId, imageId)
devices.MountDevice(containerId, "/mnt/container")
... start container at /mnt/container
devmapper: Add simple tool to test the DeviceSet commands
Add a separate docker-init binary

This may be used for the .dockerinit case if the main binary is not
statically linked.
Runtime: Automatically use docker-init if it exists

In some builds the main docker binary is not statically linked,
and as such not usable in as the .dockerinit binary, for those
cases we look for a separately shipped docker-init binary and
use that instead.
Image: Add runtime and container id args to Mount()

We will later need the runtime to get access to the VolumeSet
singleton, and the container id to have a name for the volume
for the container
Add DeviceSet interface

This interface matches the device-mapper implementation (DeviceSetDM)
but is free from any dependencies. This allows core docker code
to refer to a DeviceSet without having an explicit dependency on
the devmapper package.

This is important, because the devmapper package has external
dependencies which are not wanted in the docker client app, as it
needs to run with minimal dependencies in the docker image.
Server: Pass in device-mapper DeviceSet to server

This makes docker (but not docker-init) link to libdevmapper and will
allow it to use the DeviceSet
Runtime: Add DeviceSet singleton

This adds a DeviceSet singleton to the Runtime object which will be used for
any DeviceMapper dependent code.
Runtime: Add MountMethod to allow AUFS and device-mapper to coexist
Image: Initial support for device-mapper mounts

This supports creating images from layers and mounting them
for running a container.

Not supported yet are:
* Creating diffs between images/containers
* Creating layers for new images from a device-mapper container
Image: Deactivate image device when unmounting container

There is no need to keep all the device-mapper devices active, we
can just activate them on demand if needed.
Image: Always create a .docker-id file in the devices we create

Without this there is really no way to map back from the device-mapper
devices to the actual docker image/container ids in case the json file
somehow got lost
devmapper: Base the device-mapper names on the root dir name

This means the default is "docker-*", but for tests we get separate
prefixes for each test.
Implement docker diff for device-mapper

To do diffing we just compare file metadata, so this relies
on things like size and mtime/ctime to catch any changes.
Its *possible* to trick this by updating a file without
changing the size and setting back the mtime/ctime, but
that seems pretty unlikely to happen in reality, and lets
us avoid comparing the actual file data.
Archive: Fix up tar commandline arguments in TarFilter()

There is no need to duplicate the compression flags for
every element in the filter.
Make TarFilter more useful

There are a few changes:
* Callers can specify if they want recursive behaviour or not
* All file listings to tar are sent on stdin, to handle long lists better
* We can pass in a list of filenames which will be created as empty
  files in the tarball

This is exactly what we want for the creation of layer tarballs given
a container fs, a set of files to add and a set of whiteout files to create.
Implement container.ExportRW() on device-mapper
Runtime: Delete corresponding devices when deleting container
Delete corresponding Devices when deleting Images

If an image is deleted and there is a corresponding device
for that image we also delete the image.