Do not crash when source plugins conflict.

Fixes #3179.

This is one approach to solve the problem by keeping the `pkg` information around until we have finished loading all the source handlers. This information is discarded afterwards.
Let's just store packageName (or null) directly instead of pkg that we only use for its name