mpegvideo_enc: do not unreference frames before the code is done with them

Fixes Ticket2592

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