Refactor thumb view popup menu handling

Popup the thumb view context menu in response to the popup-menu signal
on GtkWidget.

https://bugzilla.gnome.org/show_bug.cgi?id=724905