ws

[ci skip]
Make pseudo-synchronous code more resilient to race conditions with channel.close

In workloads that aggressively open and close channels (e.g. a WebSockets/RabbitMQ proxy)
delayed operations may end up being executed after a channel is closed. For example:

ch.queue("", :exclusive => true).bind(x).subscribe do |meta, payload|
  # ...
end

will delay queue.bind and basic.consume method delivery until after the server-generated
queue name is known. If the channel is closed in the middle of this sequence of operations,
it would cause a connection-level exception.

This commit delays all queue operations until the queue name is known in a unified
way and guards delayed operations to be discarded when by the time they are
executed the channel is already closed.

For normal workloads, there will be no change of behavior.
Use RabbitMQ Tracer port if environment indicates so