avformat/aviobuf: fix null dereference in avio_close_dyn_buf()

Fixes CID1135769

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