Backport some changes from Pragha 1.3.1
 * Better protect tags and time_t on threads.
 * Use diferents time_id to scrobble and update now playing.
 * Fix submits multiple entries of one song to LastFM.
 * Betters function names and declare a lot as static.