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
Sure, but channels with an ID larger than 65535 won't be allowed to be created by the server, even if they agree on channelMax = 0