avcodec/vp3: factorize out free_tables()

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
avcodec/vp3: free tables before allocating new ones

Fixes memleak on seeking

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