Extract common code for opening a link

Previously, the following functions used almost the same code:
- on_Itemlist_row_activated
- on_popup_launch_item_selected
- on_popup_launch_item_in_tab_selected
- on_popup_launch_item_external_selected

This common code was extracted to a new function.