Merged requested to merge tobias-loew/lfortran:fix_order_deps_ordered into master
This fixes the UB, but uses a std::map instead of a std::unordered_map : using unordered_map resulted in failing tests, as some of the dependency-resolving tests may have multiple solutions. E.g.
- mod_1 depends on mod_2
- mod_1 depends on mod_3
can be resolved by [mod_2, mod_3, mod_1] but also by [mod_3, mod_2, mod_1]