Fix $*REPO chain broken by use lib
Fix $*REPO chain broken by use lib

If a "use lib" statement occurs before $*REPO is initialized and the
repository would already be in the $*REPO chain, it would never get its
.next-repo attribute set. This is caused by repository-for-spec caching
the created repositories, so only the first access determined the
next-repo. The "use lib" implementation doesn't pass a :next-repo, so it
was always undefined. OTOH if we just blindly overwrite .next-repo, we
may create loops in the chain.

Fixed doing the full "cut out of the repo-chain and re-insert properly"
dance that use-repository does, even when setting up the initial chain.

Fixes lots of "Cannot find Test in..." errors.
Thanks to Tux++ for the report!

ungrim97/rakudo,Gnouc/rakudo,Gnouc/rakudo,nbrown/rakudo,b2gills/rakudo,jonathanstowe/rakudo,rakudo/rakudo,ab5tract/rakudo,rakudo/rakudo,MasterDuke17/rakudo,azawawi/rakudo,jonathanstowe/rakudo,azawawi/rakudo,lucasbuchala/rakudo,paultcochrane/rakudo,raydiak/rakudo,labster/rakudo,awwaiid/rakudo,ugexe/rakudo,ugexe/rakudo,ungrim97/rakudo,b2gills/rakudo,softmoth/rakudo,tbrowder/rakudo,tony-o/rakudo,rakudo/rakudo,azawawi/rakudo,salortiz/rakudo,nbrown/rakudo,LLFourn/rakudo,sjn/rakudo,LLFourn/rakudo,ugexe/rakudo,ab5tract/rakudo,dankogai/rakudo,samcv/rakudo,LLFourn/rakudo,nbrown/rakudo,ugexe/rakudo,salortiz/rakudo,Gnouc/rakudo,sjn/rakudo,zostay/rakudo,awwaiid/rakudo,nbrown/rakudo,labster/rakudo,zostay/rakudo,ungrim97/rakudo,nbrown/rakudo,nbrown/rakudo,rakudo/rakudo,ungrim97/rakudo,b2gills/rakudo,sjn/rakudo,azawawi/rakudo,lucasbuchala/rakudo,sjn/rakudo,jonathanstowe/rakudo,samcv/rakudo,tbrowder/rakudo,Gnouc/rakudo,b2gills/rakudo,ugexe/rakudo,Gnouc/rakudo,labster/rakudo,tony-o/rakudo,zostay/rakudo,rakudo/rakudo,paultcochrane/rakudo,rakudo/rakudo,LLFourn/rakudo,labster/rakudo,jonathanstowe/rakudo,labster/rakudo,salortiz/rakudo,jonathanstowe/rakudo,paultcochrane/rakudo,tony-o/rakudo,b2gills/rakudo,usev6/rakudo,samcv/rakudo,ab5tract/rakudo,softmoth/rakudo,lucasbuchala/rakudo,LLFourn/rakudo,tbrowder/rakudo,awwaiid/rakudo,softmoth/rakudo,samcv/rakudo,usev6/rakudo,awwaiid/rakudo,paultcochrane/rakudo,salortiz/rakudo,azawawi/rakudo,softmoth/rakudo,MasterDuke17/rakudo,usev6/rakudo,awwaiid/rakudo,Gnouc/rakudo,raydiak/rakudo,lucasbuchala/rakudo,salortiz/rakudo,raydiak/rakudo,salortiz/rakudo,tbrowder/rakudo,MasterDuke17/rakudo,tony-o/rakudo,dankogai/rakudo,dankogai/rakudo,ungrim97/rakudo,tbrowder/rakudo,labster/rakudo,usev6/rakudo,tbrowder/rakudo,usev6/rakudo,dankogai/rakudo,MasterDuke17/rakudo,MasterDuke17/rakudo,sjn/rakudo,paultcochrane/rakudo,MasterDuke17/rakudo,softmoth/rakudo,raydiak/rakudo,tony-o/rakudo,tony-o/rakudo,samcv/rakudo,zostay/rakudo,dankogai/rakudo,ab5tract/rakudo,ab5tract/rakudo,lucasbuchala/rakudo