fix path_to_top_of_module_tree to consider multiple paths to the top of the module tree

This is a fix for the problem reported in https://github.com/hpcugent/easybuild-easyconfigs/issues/1086.

The fix in #1016 turns out to be incomplete, i.e. it doesn't fix #996 in all cases.
More specifically, a load statement for either the `icc` or `ifort` module will still be included for modules installing using an `iccifort`, `ictce` and `intel` toolchains.

The unit tests have been extended to capture this problem, so it doesn't occur again through future changes.

This warrants an EasyBuild v1.15.1 release.

Thanks for reporting this issue @kcgthb!
this warrants a function `restore_env` (i grepped the code, this is the only use case of `modify_env` in framework...