Move generally useful event_wait code to lib

Signed-off-by: Jon Ludlam <jonathan.ludlam@citrix.com>
Remove redundant definition

Signed-off-by: Jon Ludlam <jonathan.ludlam@citrix.com>
CA-134757: Queue the VM.remove operation

Signed-off-by: Jon Ludlam <jonathan.ludlam@citrix.com>
Merge pull request #1796 from jonludlam/CA-134757-creedence

CA-134757