[SF#839]Ensure menu UI update before calculating its position.

Since GtkUIManager may update menu lately, calling popup_position_func() right
after updating UI will give it incorrect size and therefore position of menu
will be wrong which may reposition menu later and cause a disaster due to a
undesirable click on menu item which appears under mouse pointer.