If a sound is added to the queue when the preview job is done processing
its current list of sounds, a leak could happen: The new sound gets
added to the queue but the job never actually processes it.
This change follows @iss's suggestion of using the WM_event_add_notifier
function to force a redraw when that is that case.
If the PreviewJob is terminating (running = false):
- First clear the sound's loading tag: Without this, the code in
sequencer_draw.c will not be able to push the sound for processing in
the second pass.
- Add the event notifier for the current scene.
A TaskPool is used to execute tasks in the backghround.
Whenever a new audio strip needs their waveform to be computed, it's
added as a task to the TaskPool.
Once the PreviewJob has submitted all available tasks to the task pool,
it waits for all of them to finish before exiting.
The TaskPool is configured to start tasks as soon as they are pushed
onto the task queue.