encoder: use allocator default buffer

Change-Id: I632ffbfd9ecb8dbebb691ec5bc97fd9c539c7ce7
handshake: write from position in pipeline

Channel.write() will cause the outgoing message to pass through the
entire pipeline, including handlers behind the codec, which is
undesirable as those handlers do not expect to participate in the
handshake.

Change-Id: I2286ae7baea6dfea7e6733e29b63150dd66b0b0b