Fix for unreliable git submodule sync

This does a few things before the git submodule sync and update happens.
For each submodule listed in .gitmodules (parsed from git config output) it
loops over each line group of (2) and does an explicit git submodule add. On
repos where the submodule repo url is unchanged - it is a no-op. On repos
where it has changed - this actually takes care of the actual url change in
the repo data. The `git submodule sync` that then follows will properly update
the urls in .git/config - something that I've never seen work with only a
`submodule sync`.