avio: add a destructor for AVIOContext

Before this commit, AVIOContext is to be freed with a plain av_free(),
which prevents us from adding any deeper structure to it.

(cherry picked from commit 99684f3ae752fc8bfb44a2dd1482f8d7a3d8536d)
Signed-off-by: James Almer <jamrial@gmail.com>
