CA-105160: Make sure that event_wait is cancellable

Signed-off-by: Jon Ludlam <jonathan.ludlam@eu.citrix.com>