Ensure detected extensions have valid package names

Fixes #2489