Fix race conditions during PlayFile()

this PR trace the starting playing item's play state callback state change, with lock protect.
with this, kill the race condition in original code in PlayFile after starting flag reset.
there is chance OnPlaybackStarted/OnPlaybackEnded be called twice (once by xbmc main thread in the place, once by player thread called just after the starting flag set to false). or other race condition between IsPlaying() check and OnPlaybackStarted/OnPlaybackEnded/OnPlaybackStopped callbacks.
since we had to delay the callback process during starting state, we need to record which callbacks were called during starting state, so I add code for tracing that, and also need to not bother by the previous playing item's stopped/ended callback.
finally after starting state finished, we do the callback happened during starting state, that's all this commit does.
I did this because in https://github.com/xbmc/xbmc/pull/2228 @elupus said there is race condition if OpenFile return true, I checked, there indeed is race condition, but not caused by PR 2228, it existed for years, PR 2228 did work for fixing the crash and not related to the race condition mentioned. So I finally figure a way in this PR to kill the race condition, how does this like?

thanks @MartijnKaijser , notify me that this PR may fix ticket http://trac.xbmc.org/ticket/13064, it does. in my test, paplayer callback OnPlaybackStarted() later than starting flag set false when switching playing items, it will cause current code in CApplication::PlayFile() call OnPlaybackStarted() because IsPlaying() return true, and the paplayer will also call OnPlaybackStarted() after a little awhile it starting ProcessStream. by this PR, the m_ePlayState will be STARTING for this condition, and no call OnPlaybackStarted() in xbmc thread then paplayer will do its work.

UPDATED: this PR also include commits fix crash and wrong behaviors when second PlayFile is called during first's busy loop conditions.