The intended API contract is that streaming threads can't still be running when we call wg_parser_destroy(). In quartz and wmvcore they should have been stopped already. From reading mfplat code it doesn't look like it should be possible to hit this case either: source_async_commands_Invoke() grabs the source cs and checks its state inside that cs; media_source_Shutdown() also grabs the cs and sets the state inside that CS.
How exactly are you seeing this deadlock? What's the backtrace look like?