Avoid instantiating ResourceLoader modules twice

Commit 13169c88 seperated out the call to getModule from the assignment to the
$modules array in order to add a check for private modules, so they can be
filtered out (see bug 34907). This had the (presumably unintended) side-effect
of causing modules to be instantiated twice.

Change-Id: Iccd7f3d3d473c5a43107842ed4e1cf08857a3886