engine: Make Engine threadsafe

This allows registering handlers after you've started using the engine,
as well as setting hack envs.

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
Add generic /cmd entrypoint w/ cli support

If you do
  docker devmapper:resize -o Key=Value -o Foo=Bar plugin:op arg1 arg2

This will do a GET http request to /cmd/devmapper/resize with the
arguments and options as keys. This will then try to spawn a job on
the engine called "devmapper:resize" with the arg1, arg2, etc as
arguments and the -o options as environment.

Also, any graph driver implementing the engine.Installer interface
will get installed on the engine when the daemon is created.

This will be used by e.g. the devicemapper to allow driver-specific
operations like pool resizing.

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

This does the "reverse" of HumanSize, i.e. maps a string to an int64
using SI prefixes for the extension.

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

This lets you live-resize the devicemapper loopback files for the pool.
Use it like this:
 docker devicemapper:resize-pool 140G

Also, it changes the way pool sizes are reported to use the utils.HumanSize
call which uses base 1000, not 1024, to match the FromHumanSize call.

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
devicemapper: Add docker driver resize operations

This lets you resize individual images or containers like:

docker devicemapper:resize f4eff8c9f36d3114c3a16fc7b213512153a2d25caef6f11f385020e6558600f1 12G

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

This adds a BlockDeviceDiscardAll which discards everything on the device,
and makes BlockDeviceDiscard take offset and length arguments.

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

This command suspends the pool, extracts all metadata from the
metadata pool and then manually discards all regions not in use on the
data device. This will re-sparsify the underlying loopback file and
regain space on the host operating system.

This is required in some cases because the discards we do when
deleting images and containers isn't enought to fully free all space
unless you have a very new kernel.  See:
https://github.com/dotcloud/docker/issues/3182#issuecomment-32888284

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