mov: prevent double free if the caller replaces the io context.

Fixes Ticket2148

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>