E3-1378: Fix make clean
This is a surprisingly more complex change than expected. At its heart, the
issue that was happening was that make clean would also trigger all of the module fetching,
which fails if you have non-installed module. This is of course not ideal.
The solution is at least in part to move the db_internal expansion (and hence all module fetching as well) to the later passes of the build engine, since make clean only runs on the first pass.
Note that this is similar to how this is done in EPICS base and is necessary: we allow for arch-specific dependencies so this really ought to be done after T_A is defined.
There is still an issue in that make debug fails when it hits the third pass, since at that point
we actually fetch the module versions and dependencies. This isn't great, but it
strikes me as less of an issue than make clean which is actually used by users.