Convert sources to lock format before comparing.

If the Gemfile sources lock to the same result as the current locked sources, they haven't changed.

This was extracted from the in-progress fix for #3175, and fixes #3298.