core: handling of possible race when deactivating domain

When deactivating the last  master domain a new thread is started to make sure that
the domain is deactivated only after the tasks are cleared.
In case of engine crash during that time the domain may remain in status
LOCKED, because nothing will restart the thread on the engine start (as
the tasks were cleared).
The infrastructure that we currently have to handle that case is the
compensation context, in this patch i create a compensation context that
will assure that the domain will return to the appropiate status in case
of an engine crash.

Change-Id: If4e482a2a13741e8b4509851d9d8e4645d8b81e6
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1138124
Signed-off-by: Liron Aravot <laravot@redhat.com>