Spawn support for TaskManager and 2 locking fixes

There's a number of cases where we grab a lock and then spawn a worker
to complete an action. Since the TaskManager() is not being used as a
context manager in these cases, it's really easy to mess this up and
create a code path where we accidentally leave a node locked.

This patch adds support to TaskManager to allow you to spawn a worker
on __exit__. This consolidates all of the logic to make sure we unlock
a node when we should. All cases where we lock and spawn a worker have
been updated to use this.

This happens to fix a bug in set_console_mode() where there's a path
that can leave a node locked. If the console is already in the
appropriate mode, it doesn't spawn a worker, however it would leave
the node locked.

This also fixes a bug in _check_deploy_timeouts() where if the spawn
failed due to something other than NoFreeConductorWorkers or if
the thread-finished-callback linking failed, we would leave a node
locked.

Tests where we're actually testing eventlet's thread behavior with
respect to link() have been moved to the task_manager test file.
They were refactored to remove unnecessary sleeps and incorrect
assumptions about eventlet scheduling. (They assumed that a spawn()
scheduled the new thread immediately.)

self._spawn_worker() tests in test_manager were also moved to their own
test class to be true unit tests.

Change-Id: I6b4ce46e8d1a67a6e1673cc9256b5da3eae3ff32
Merge "Spawn support for TaskManager and 2 locking fixes"