A lot of this code is exactly the same as what is in `amqp_queue_frame()`. How about abstracting this out so that the common code is shared.