Add a state check in the main loop.

If our playlist initialization failed, we can crash without this check
because the init changes our state to IDLE, yet we try to start playback
anyways.