Adding a wait and release function for cl events. This is needed for Nvidia platforms, which apparently allocate a not inconsiderable amount of memory on each kernel call linked the kernel event, which needs to be released explicitly.