COMETD-513 - Client-side half-closed connections should discard server messages.

Improved the implementation to maintain a current delegate object at the transport
level, and by checking whether operations are performed on the same delegate.
If they are operating on a different delegate, they are not performed.
This allows for failures of a batch of messages to not interfere with reconnections
that have created a different delegate instance.
Merged branch '2.8.x' into 'master'.