Dependency scanning does not care about the order of submodules for correctness, so sort the submodules so that we get the same command-lines to build the module across different TUs. Otherwise, the order of inferred submodules can vary depending on the order of #includes in the including TU.
Note: a true canonical order for Module::submodules would probably be to match the order of module decls within the modulemap file and sort the header files for any inferred modules, but that might be expensive to compute all the time (requires iterating a directory in the filesystem).