Fix an issue where the engine context did not wait for audio threads to finish before destructing.

With this commit, audio threads can now assert that the owner engine context is valid
throughout the entire execution.