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
@carlhoerberg I think the point may be that channel 0 is special-cased in the protocol and cannot be used like "normal" channels?