fixes #7596 - validate plugin dependencies when loading, various fixes

this bit is quite similar to ```test_core_dependency```. Otoh, there's no test that verifies that a plugin with satisfiable dependency is valid...