fix modules core: simultaneous (de-)activations

When you de/activate multiple modules at once (as is the case when
importing an export file) only the first one will get noticed and only
its hooks will be fired. This commit fixes that.