Improve HomographFixer to solve LT-13940 and other problems

As well as the crash which occurs if an entry has a lexeme form
and alternate form with the same form, this fix causes HN to be
set to zero when needed, avoids renumbering based on
alternate forms, avoids unnecessary re-ordering of HNs, and correctly
handles entries (e.g., from FW6) with no HN at all. Also corrected
test to validate input BEFORE changing it!

Change-Id: I407dfa85bf4ef7faf1b07ae6d23dde8080294ea9