AVFrame: factor out freeing the side data

Signed-off-by: Anton Khirnov <anton@khirnov.net>