Verify number of frames processed

Do not include the trailing silence when counting processed frames, so
that the number of frames written to the output stream can be asserted
against the length of the input signal.

Avoid unnecessary copy of the input signal in the callback function.