Fix IndexOutOfBoundException when an empty array is written to EmbeddedChannel