ci: Improve style check script
Sync with changes from GTK:
- Set a git config to work around security improvements in recent git.
- Only fetch the two branches we want to compare for the style check.
- Use the existing git merge-base command to find their common ancestor.