Factor out some common code for constructing SSH2_CHANNEL_OPEN.