mainloop: implement gio_poll_dispatch_mod

libqb may need to modify the events or dispatch function for a
previously-added poll source.

(cherry picked from commit 5e869199eb9d780e5d96110028c9b1a5dabc67fc)