[DependencyGraph] Ensure that recurse invocations of `detach_vertex_named` don't lead to messaging `nil`.

Closes https://github.com/CocoaPods/CocoaPods/issues/2805.