multiqueue: Fix hanging if shut down while handling a serialized query

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