Bug 1062293 - Add specialized logging to track the lifetime state change of MediaStreamGraphs r=jesup

As noted in the comment, it is very useful to have this interleaved with the ADB
logcat on Android/b2g, because this way we can correlate gecko state with the
state of the Android HAL.

--HG--
extra : rebase_source : 80df45d0851a06daac3abeab2ea4b5bc7e58a21d
Bug 1062293 - Ensure the graph stays alive when doing driver switches and audio stream shutdown operations. r=jesup

This basically gets a grip on the graph while doing driver switches operations
on another thread (system thread or audio thread), because those can take time.
Because the graph is refcounted, it'll be freed when the last operation
finishes, which is what we want.

This patch also only allows driver switching when the graph is in state
LIFECYCLE_RUNNING, which is what we want anyway.

--HG--
extra : rebase_source : 76365981ec909796509bd21e616b1ff8602406bd
Bug 1062293 - Fix opensl's cubeb backend draining. r=kinetik

This ensures the callback won't be called when draining is done.

--HG--
extra : rebase_source : b876e19d03aa58105eceba341e7a394f1f25473c