Ensure the DirectShow graph is completely destroyed after CloseMediaPrivate().

Destroy all dynamic menus that can possibly hold a reference on an object of the graph.

This fixes a strange issue with the logo not being redrawn in some cases when MadVR was used.
Ensure the keyframe timings array is read/written only by the main thread.

Revert 02356359a23ded82585560fade11b9089d590734 and remove the other duplicate I initially kept. Even if we get that info from the DirectShow graph, the array is filled and used only by the main thread. It's safer and more consistent to have it cleared by the same thread.
PGS Subtitles: Fix subtitles not being removed from screen after d8deeda49e270d02e9eae795265494184f409b29

Since we drop empty segments we were trying to update the end time of segments that weren't in the queue and we ended up modifying the previous segment that was completely unrelated.

Fixes #3691.