decimate: check for avctx ptr before closing.

Fixes a crash init failed before setting avctx.