vlm: store player finished state in media
This patch stores the finished state in the media context of VLM directly from the player callback.
The previous check on the player state to determine if the media was
played was insufficient. The player state can go quickly from
VLC_PLAYER_STATE_STOPPING
to VLC_PLAYER_STATE_STOPPED
and when it
reaches the STOPPED
state, there is basically no way to know if we are
in the initial state or if we actually finished playing a media.
This was causing a deadlock where the VLM thread loop kept thinking the player was reset to its initial state and never switched to the next media.