mpegtsmux: Fix memory leak when using prepare_func