Use poll instead of threading.Event in heartbeat thread

poll() does not rely on absolute time.
This fixes an issue where the system clock may be changed, and
the heartbeat thread would stop heartbeating.

This also gives us flexibility to force a heartbeat in a later
change.

Change-Id: Ifde7b53f59788addc43a5dac95c7b6519d87e834
Closes-Bug: 1355375
Force heartbeat immediately after async command completes

This change passes the agent object into extensions, such that
they may call agent methods as needed. It also causes async
commands to force a heartbeat immediately after completing the
command. This allows Ironic to get a heartbeat and continue
work as quickly as possible, while also allowing deployers to
configure Ironic (agent) to heartbeat less often.

Change-Id: Ib3c3a43dfd0ed4ed51b7d52ac099f01181ca822f
Write image directly to disk

Write image directly to disk by telling qemu-img that the output
file is the disk. Still uses O_DIRECT directly within qemu-img.

This avoids the need to have a huge amount of system memory to be
able to deploy an image that contains a huge disk.

The only feature left behind by that commit is the 64K block size.

Change-Id: If60bcd82581b2ea76c4acbc3eaa3f317d2ee6590