Fix corruption bug in sortkeys containing underscores

We normalize underscores to spaces in sortkeys in toDataElement,
but when toDomElements recomputes the normalization to decide
if the sortkey really changed, it doesn't normalize underscores.
This is broken, both code paths need to use the same normalization;
we do this correctly for the category name.

This bug appears to date back to the introduction of category
support in March 2013 :(

Spotted in https://it.wikipedia.org/?diff=67220927

Change-Id: Ie3257fa335f3bd24a36c8654f3f5a24e89d7a9b9