loader: fix wait for sub-module resolving before resolving module promise