Fix qt-git-merge-mainlines to deal with submodules dynamically

Change-Id: Ia8fb489715e2ba0f0c29ad76ada20800a1ab5c54
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>