Create a promise waiting for an event