Use custom repositories from composer.json in require command

Fixes https://github.com/composer/composer/issues/3505