Fix segfault if gitmodules is invalid

The `git_submodule_reload_all` call could end up dereferencing a NULL pointer if there was an error while attempting to load the submodules config data (i.e. invalid content in the `.gitmodules` file).  This fixes it. See libgit2/objective-git#345 for the initial report.