Disable authorizer after command (fixes #6)

- After processing a command on the server the authorizer is disabled
  again by setting it to NULL. Otherwise other database operations like
  saving song statistics might be denied.
- This should fix issue #6.
Merge pull request #18 from hfs/reset_authorizer

Disable authorizer after command (fixes #6)
autoupdate, tweak configure.ac
cron: call the correct hook from event_update()

Fixes: #12
stats DB: Add transaction rollback helper function
stats DB: Regroup SQL in maintenance/creation/use

SQL statements are grouped by their use: Generic schema independent
statements e.g. to start or finish a transaction are in group
"maintenance". All "create table" statements are in their own group. All
the data querying and updating stuff is in the third group.

This is useful, because different statements are needed at different
times. You can't e.g. prepare a data querying statement if the table
does not exist yet, or on the other hand prepare a table creation
statement if the table is already there.
stats: Add DB schema migration mechanism

- The DB schema version is saved as user_version in the database.
- During startup the version is checked and if the database has an old,
  known version, migration SQL statements are executed (all in one
  transaction) to make the changes needed to bring the DB to the newest
  schema version.
- If the DB does not exist yet, it is created with the newest version
  right away.
stats DB: schema version 11: last_played & karma

- Upgrade DB schema version from 10 to 11
- Add column "last_played" in table "song". This shall take the Unix
  time when a song was last played.
- Add column "karma" in table "song". Karma rating is an idea stolen
  from Amarok 1.4. Karma is a percent value. Initially a song has karma
  50. Every time a song is played, the karma is updated as
    karma = (karma + percent_played) / 2
  This way songs which are played often converge to 100. Songs which you
  constantly skip converge to 0. New, never played or unsettled songs
  are in the "unknown" area around 50.
- The "karma" column has a default of 50 and constraints to keep it in
  [0, 100].
stats: Set 'karma' and 'last_played' when played

- No longer ignore songs which were not played "long enough". Instead
  update the song info every time.
- Set 'last_played' of the song to the current time stamp
- Update the karma rating: karma = (karma + percent_played + 1) / 2
  (+1 to round up to be able to reach 100%)
- The play counters of songs, albums etc are still handled in the same
  way and increased if the song was played long enough
stats: Reduce copy & paste

- Small code refactoring, no functional changes
stats: Karma and 'Last played' in 'eugene listinfo'

- Expose Karma and Last played info in the stats server protocol
- Show both in eugene's "listinfo" command output
- Last played is not shown if a song was not yet played
stats: Add server command 'karma' for songs

- Add a command 'karma' to the stats server to set the Karma rating in
  absolute fashion (percentage between 0 and 100) for songs
stats: Add client command 'karma'

- 'eugene' command 'karma' to set the karma rating of either the current
  playing song or songs based on a given SQL clause
- Connects to the stats server and calls its 'karma' command in turn
News: Add entry for karma and last played feature
scrobbler: implement libCURL timeouts

mpdscribble commit:bb3f7d215d0e18bfb6de99d847253031d75a2f9b
scrobbler: prevent recursive read calls

This fixes an assertion failure with CURL 7.21.1, which was because a
callback was invoked twice, recursively.

mpdscribble commit:f488bc91f0311bfdfbef28a6d75f37f83b2e1057
scrobbler: (journal) don't save "(null)" values

Check a string pointer before passing it to fprintf().

mpdscribble commit:ff64576018f522be31b17d59311abc0d0df2b297
scrobbler: submit track numbers

Fill the "n" parameter with a real value from MPD_TAG_TRACK.

mpdscribble commit:0a2c6282a28068ff11188dc11f88aeb83ad5aad5
log: use ISO8601 date format

mpdscribble commit:13f3dd83effddaf30d1df80905358817ec19c6e4
scrobbler: fix memory leak in as_songchange()

Free the stack record object before returning.

mpdscribble commit:376800d671e826e460d34754e1e612ffd5d548d4