Before the fix, tags file sorting was done alphabetically. That would
treat line numbers as strings, and so, for example, if the same tag was
placed on the same page on lines, say, 9 and 114, the order you would
get, 114 would go first, instead of 9.
Fix adds proper entries comparison to the sort function.
If section title contains multibyte chars, the fold shortening function
often fails, because it works with text as array of bytes, not
characters (see strlen() doc for example).
This commit fixes this issue.