misc: Fix bad type
misc: Simplify code flow in process_deferred_messages

Rather than use complicated gboolean-cast-to-gpointer to make
decisions, simply use two different callbacks.