Factor out a common queue interface.

This collapses peer_status_queue, response_queue, and message_queue to
use the same interface, now queue<T>.  message_queue provides some minor
additions to the interface related to endpoint attachment and
topic-prefix subscription.