Discard envelopes with neither buffer nor event attached at InputChannel

Fixes the following problem: serialization in RecordWriter might result in sending
of empty buffers (e.g. writer sends out a full buffer, requests a new one, and then
gets flushed), which then causes an error at the receiving InputChannel, because of
an envelope with neither buffer nor event attached.