submodule.c: correctly handle nested submodules in is_submodule_modified