Light mode: do --endpoint / --sources consistency before first use of --endpoint

As reported by this question on stackexchange, it seems that when using the rpc get command, the check of the light mode that --endpoint is contained in --sources does not trigger.

This check is useful, because it indicates a CLI mistake and provides a way to move forward. This issue tracks why this check does not trigger in the user's example and how to fix that.

MR for the fix: !3370 (merged)

Edited by Clément Hurlin