Modified clWaitForEvents to work with event completion in any order.