core: prevent possible deadlock between monitoring threads

If VM went down during migration in the source host, the monitoring
(VURTI) thread of the source host tries to destroy the VM in the
destination host. In order to destroy the VM in the destination host, it
tries to lock the destination host.

When we have two monitoring threads that try to do it, we end-up in a
deadlock because each of them locks the host it monitors and tries to
lock the other one.

This patch solves this problem by postponing the destroy operation on
the destination host to take place after the lock on the monitored host
is released.

It is safe to do it that way because the status of the VM in the
destination host must be either Down or MigratingTo. If the status is
MigratingTo, the monitoring of the destination host just ignores the VM.
If the status is Down, the monitoring of the destination host will just
destroy the VM and the second destroy operation will fail.

Change-Id: Ia4c52e0f8109f9599965078d2c6dd4db705cec97
Bug-Url: https://bugzilla.redhat.com/1142776
Signed-off-by: Arik Hadas <ahadas@redhat.com>