theora: fix memleak in case of error or discontinuity

Closes #9414