Don't load same module multiple times if resolved from differnt paths

There was an optimization which compared the dependency paths instead of
the hashes if the same modules where compared multiple times. This was
not taking into account that a module might be referenced from multiple
paths.

Removing the optimization solves the issue and does not seem to cause
any noticable performance drops.

- Fixes issue #692