audio/core: Rework how we hook up end of track handling.