submodule: fix regression for deinit without submodules