test: waitForJobEventsActual waits for a specified number of events.

Signed-off-by: Blaž Hrastnik <blaz.hrast@gmail.com>