Fix variant switching media index test
The original test was invoking the playlist reload callback which tested whether the media index was updating correctly after a refresh. Now, the test correctly triggers the a variant switch after downloading a segment. Consolidated media index update code and ensured state is properly updated after a switch.