app: fix gimp_widget_get_monitor()

Do the right thing for widgets that have a window when the widget is
realized, and simply call gimp_get_monitor_at_pointer() if it's not
realized.