avformat/cache: Fix memleak of tree entries