don't call the output callback if there is no available buffer space

and also remove an unnecessary copy done before passing the data to the input callback