notebook: Fix crash on tab close

Since infobars notebook_tab_close_clicked_cb() wants a GeanyDocument as userdata.
show_tab_bar_popup_menu() on the other hand wants the actual GtkNotebook child.
Don't use the notebook page widget for tab popup

Directly use the GeanyDocument rather than pass the notebook page
widget and get the document from that.  This makes the code more future
proof and less weird.
Remove unused variables and avoid variable shadowing