Limit the number of menu lines visible in line mode if there are less
items than lines. This brings wmenu's behavior in line with dmenu's.
Closes https://codeberg.org/adnano/wmenu/issues/64
Sorting and deduplicating elements after all items have been registered
improves the time complexity of constructing the item list from O(n^2)
to O(n log n). On a system with about 4000 menu items, this reduces
startup time from about 0.21 seconds to 0.13 seconds.