[Analyzer] Fixes an issue using the lock version of a subspec

Basically, `generate_podfile_state` was flattening the subspecs to the root name. Then later `generate_version_locking_dependencies` would call `dependency_to_lock_pod_named` with the root name. Which would match the first subspec.

Fixed #2135