Close the PBXProject to ensure next instance uses current state.
Don't fail if using outside of CP context.

Pathname is already available when using from CP, but as we need it, we should explicitly require it.