Only add new active connections if channel is active
Only add new active connections if channel is active

We previously checked if the channel was active using a read lock, but
this could go stale, as the channel could be closed between the time the
check was done and the connection being added -- and the connection
would be left in an active state, causing the channel to never close.

To avoid this, we now check the state and add the connection atomically.

If the connection is not added, it means the channel is closed, and so
we close the connection to avoid leaving a rogue TCP connection.

uber/tchannel-go,uber/tchannel-go