Make sure to remove any trailing menu separators

This happens frequently on Mac, since Qt will rearrange some menu items
to match the Mac UI.

Change-Id: I1a96effbb05c68ac349b10751def01958508b30e