Plug some memory leaks in movie thumb generator

fixes #1876