Common up calls to index.processCommits()

The processCommits() function inserts a commit and all its ancestors into
the 'commits' table in the database, if they aren't already there.  It
needs to be called before running any code that expects to be able to
access commits as gitutils.Commit objects.

It was previously both from src/background/githook.py and from various
functions in src/index.py (e.g. createBranch() and updateBranch().)  Now
it's simply called on all new SHA-1s that the commit hook receives as
input.  This is effectively what it did before as well, of course, but
with less code.

Also, since processCommits() can raise IndexException, and the handler
for that exception uses the 'info' local which is first assigned after
some of the calls to processCommits(), the exception handler would
sometimes crash, and not emit a proper error message.  This problem is
addressed by this fix.