Perlize the CGI program (backward breakage in conf)

The activities.cgi was completely rewritten using Perl (was a bash
script). About twice faster, but more importantly allows further
integration with Gitolite's permission mechanism.

Reversing the log entry ordering is now done on the server side.
activities.cgi: Support for gitolite per-repo authorization

By supplying a proper $repo_auth_hook via the config file, the CGI
program can be directed to send activity data only for repos that
the user is authorized to read.

Sample hook implementation in gitolite-activites.conf.sample.
Revise log file open/close handling

If log file open fails, send 403 Forbidden with a reason message.
If file cosing fails, do not die, only warn. And finally, send
200 OK only if result really is constructed without errors.
CGI url change (backwards breakage)

The JSON document query URL has been changed from "/cgi-bin/activities.cgi"
 -> "/gitolite-activities/". This was necessary so that web server can be
configured to run the CGI program in the same auth realm as gitweb itself;
this in turn is required so that gitolite per-repo authorization check can
be made based on remote_user identity.

Web server config must be altered accordingly even if per-repo auth is not
used.
Merge branch 'activities' into dists/precise