Respect channelMax

Limit number of channels to channelMax as negotiated with the server.
Try to find an available channel id, even if it means to wrap around.
Return ErrChannelMax if no available channel id can be found.

Addresses #115
The wraparound in `channelRegistry` is racy because it uses this side effect as the condition for a free channel.