[boot] A trivial patch that checks `mod_count` before using it.
[boot] A trivial patch that checks `mod_count` before using it.

This patch just reorders the code, to actually do the check if there are any
modules (represented by `mod_count`) before any setup or lookup is done.

cmr/seL4,cmr/seL4,zhicheng/seL4,zhicheng/seL4,zhicheng/seL4,cmr/seL4