[FLINK-998] Close TCP connections after destroying logical channels

- This commit introduces reference-counting to keep track of the
  InputChannel and OutputChannel instances, which share the same
  physical TCP connection.

- When the logical channels are released, the reference count will
  reach 0 and the respective TCP connection can safely be closed.

- Furthermore, the debug thread in the OutboundConnectionQueue is
  properly shut down and all queued buffers are freed when the
  channel is closed or an Exception occurs.

This closes #255.