Fix a theoretical config desynchronisation issue.

In rare cases, 'cabal.sandbox.config' and 'dist/setup-config' could
theoretically become desynchronised. Add a sanity check against this
possibility.