Assert that redeclarations have the same linkage.

It is somewhat hard to test linkage, so I decided to try to add an assert. This
already found some interesting cases where there were different.