hevc: Don't free something before it has been finished with

For whatever reason didn't crash on Ubuntu, but crashed hard on
Windows.