hevc: properly handle errors in the parser
hevc: avoid an infinite loop in parsing

This happened when we consumed bytes from buf but didn't write into
poutbuf, because ff_combine_frame assumes the input and output buffers
are the same, it ignores END_NOT_FOUND if the buffer size is 0.