I was suggested to clear the menu while it was open to see if selection is reset on Windows. With the help of a timer, ~~and re-running the test app 13 times because it keeps randomly crashing when clicking on any button~~, I conclude that it resets the selection.
When opening the menu with 3 items, and then pressing the down arrow to select the 1st item, when 1st item is removed, selection disappears and no other item is selected. Pressing the down arrow again then selects the 1st item.
With this patch, I get the similar behavior in Wine. Without, after the item is removed, pressing the down arrow selects the 2nd item.