The last buffer received from the circular buffer is never freed. When we are
done draining, we jump to "thread_exit" but we haven't called
gst_ticircbuffer_data_consumed on the encDataWindow.
The thread_failure condition was already releasing this buffer if it was
non-null. A proposed fix is attached that moves this code to where it frees the
buffer for thread_exit as well.