Prevent false positive on duplicate packages

Composer will try to get the path multiple times for a package, so this needs to also check the name stored inside the attempted path to make sure it's different from the already-registered package for that path.