Intel GPUs don't fire the callbacks registered with set_callback()
until the underlying OpenCL event object is destroyed. This changes
the test so that the events go out of scope or are explicitly reset
before checking that the callback has been executed.
This adds a method to the event class which allows the user to
register a callback function to be invoked when the event reaches
the specified state (e.g. when it completes).