Upgrade to pygit2 0.19
database: Use the new pygit2.TreeBuilder API
database: speed-up "abort_changes" using git_checkout