libavsmash: Integrate the codes of cleaning up video decode handler.