Factor shared code out of wq_msg_queue callbacks.