host: combined the AddJob and SetInternalIP functions, since they both cause persistence for the host state to be fired and are presently never used in isolation anyway.

Signed-off-by: Eric Myhre <eric@flynn.io>
host: Transforming host state persistence to use boltdb for persistence instead of flat files.

Components:
 - Only initialize persistence db filehandle once.
 - Move persistence path to host state setup time, and ensure it has a default when starting the host executable.  (This is mostly clarifying behavior because previously persistence would do some rather odd things if restore hadn't previously been called.)
 - Bring go-check into the host state tests, because these tests are touching the filesystem and crave tmpdirs.
 - Change filenames for host state.  (Attempting to open one of the old json files will cause boltdb to report an error; this makes that migration forgetful, but survivable.  And json is no longer an accurate description.)
 - When persisting host state changes, limit the serialization and disk changes to the job that is being changed.
 - Remove stateFileMtx from host state.  Use of boltdb has its own internal locking mechanisms which obviate the need for this mutex.
 - Place persistence back into the same control flow as the state changes that trigger it, so persistence is complete by the time the mutation returns.  (This is more feasible than before since the amount of changes flushed to disk by ever persist call is now limited in scope, and doing so makes testing and other behavior less complicated.)
 - Split the interface backends use to declare their persistence needs into two parts, one for per-job state and one for global state.  Neither is necessary.
 - Libvirt backend actually has no use for global state, so since that interface is now separate, we'll drop it.

Signed-off-by: Eric Myhre <eric@flynn.io>
host: During host backend revivification, dispatch container connection attempts in bulk, and gather them later.  This prevents their timeouts from occurring serially, which could cause host service launch to time out in the case of many dead containers.

Signed-off-by: Eric Myhre <eric@flynn.io>
Merge pull request #581 from flynn/host-state-database

Host state database
Vagrantfile: add a configuration patch to fix slow networking on some hosts.

See also https://github.com/mitchellh/vagrant/issues/1172 and https://gist.github.com/simono/73e37d8c3a45664c7045 for a description of the problem and the origins of this fix.

Signed-off-by: Eric Myhre <eric@flynn.io>