Call #deregisterServiceProvider() outside of the iteration over the existing service providers

Deregistering plugins modifies the map of providers, which is exactly the map we're iterating over. Depending on the order of the iteration this will lead to CMEs or might be completely invisible.