[Lockfile] Fix crash when installing with subspecs

\c @alloy, @kylef